Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Feb 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post CSS not working properly

    Please take a look at this code, CSS file attached

    Code:
    <html>
    <head>
    	<title>MDU</title>
    	<link rel="stylesheet" type="text/css" href="style.css">
    </head>
    <body>
    	<div id="main">
    		<div class="border"></div>
    
    		<div id="image">
    			<img src="logo.gif">
    			<h4>
    				<p>Maharishi Dayanand University, Rohtak</p>
    				<p>(A State University Estabilished under Haryana Act No. XXV of 1975)</p>
    			</h4>
    		</div>
    
    		<div class="center" class="resdata" ><h3>Result</h3></div>
    
    		<div class="decdate">Date of result Declaration: 20/09/2012</div>
    		
    		<div class="heading">Student Details</div>
    
    		<div  id="detail_table">
    			<table>
    				<tr>
    					<th>Reg.No.</th>
    					<td>1173300294</td>
    					<th class="padright">Roll No.:</th>
    					<td>1136635116</td>
    				</tr>
    				<tr>
    					<th>Student Name:</th>
    					<td>Student</td>
    					<th class="padright">Father Name:</th>
    					<td>Father</td>
    				</tr>
    				<tr>
    					<th>Course Code:</th>
    					<td>Bachelor Of Technology</td>
    					<th class="padright">College Code:</th>
    					<td>F266</td>
    				</tr>
    				<tr>
    					<th>College Name:</th>
    					<td colspan="3">Manav Rachna College of Engeneering</td>
    				</tr>
    			</table>
    		</div>
    
    		<div class="heading">Obtained Maks Details</div>
    		
    		<!-- <div id="bottomtable"> -->
    			<table id="markstable">
    				<tr><th>Subject</th><th>Marks</th><th>Total</th></tr>
    				<tr><td>1004:</td><td>056 033</td><td>089</td></tr>
    				<tr><td>1006:</td><td>054 036</td><td>090</td></tr>
    				<tr><td>1008:</td><td>046 032</td><td>078</td></tr>
    				<tr><td>1011:</td><td>021 018</td><td>039</td></tr>
    				<tr><td>1013:</td><td>020 017</td><td>037</td></tr>
    				<tr><td>1015:</td><td>023 021</td><td>044</td></tr>
    				<tr><td>1017:</td><td>040 030</td><td>070</td></tr>
    				<tr><td>1019:</td><td>078 032</td><td>110</td></tr>
    				<tr><td>1020:</td><td>050 034</td><td>084</td></tr>
    				<tr><td>1021:</td><td>023 020</td><td>043</td></tr>
    				<tr><td>1022:</td><td>40</td> <td>040</td></tr>
    				<tr><td>EVN:</td> <td>C</td>  <td></td></tr>
    				<tr><td></td><td>Total</td><td>724</td></tr>
    			</table>
    		<!-- </div> -->
    		
    		<div class="resdata">
    			<h3>Result: Pass</h3>
    			<p>
    				<h4>
    					<u>NOTE:</u>
    					In R.L.A./R.L.E. cases (Result Late due to non-receipt/non-eligibility of awards) the student concerned should submit details viz: name of examination center, date of examination, name of subject (where A.W. has been indicated) along with 	a copy of the downloaded result to the concerned Result Branch within 10 days positively, failing which he/she will be treated ‘Absent’ in the said paper and the result will be finalized accordingly.
    				</h4>
    			</p>
    		</div>
    		<div class="border">
    		</div>
    	</div>
    </body>
    </html>
    For second table, with #markstable, when i apply border on td, th ,it also gets applie on upper table too, why is this happening?
    Also, there's no border when I add border only on th or td. Please explain why.

    And this is my second CSS file so i might've followed many bad practices, any tips for improving my HTML/CSS are welcome
    Attached Files Attached Files

  • #2
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,335
    Thanks
    5
    Thanked 363 Times in 360 Posts
    To reference id's in CSS, you would use the # sign, classes would be the "."

    You reference it correctly in your description above, but in your actual CSS file, you reference a class of "markstable".
    Teed


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •