Hello and welcome to our community! Is this your first visit?
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
    Thanked 0 Times in 0 Posts

    Post CSS not working properly

    Please take a look at this code, CSS file attached

    	<link rel="stylesheet" type="text/css" href="style.css">
    	<div id="main">
    		<div class="border"></div>
    		<div id="image">
    			<img src="logo.gif">
    				<p>Maharishi Dayanand University, Rohtak</p>
    				<p>(A State University Estabilished under Haryana Act No. XXV of 1975)</p>
    		<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">
    					<th class="padright">Roll No.:</th>
    					<th>Student Name:</th>
    					<th class="padright">Father Name:</th>
    					<th>Course Code:</th>
    					<td>Bachelor Of Technology</td>
    					<th class="padright">College Code:</th>
    					<th>College Name:</th>
    					<td colspan="3">Manav Rachna College of Engeneering</td>
    		<div class="heading">Obtained Maks Details</div>
    		<!-- <div id="bottomtable"> -->
    			<table id="markstable">
    				<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>
    		<!-- </div> -->
    		<div class="resdata">
    			<h3>Result: Pass</h3>
    					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.
    		<div class="border">
    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. #2
    Senior Coder
    Join Date
    Aug 2010
    High Point, NC
    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".


Posting Permissions

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