genzedu777 Posted November 14, 2010 Share Posted November 14, 2010 Hi all, I realised after adding a javascript code and a tag <div class=district_1>, my font-family for NORTH DISTRICT is different from what I have set in #container, hence I decided to write another CSS code specifically for <div class=district_1> with a font-size and font-family, however it does not work, it only changes the font-size but not the font-family. I have attached an example for your reference I realised it happens only in IE browser. Chrome, Safari and Firefox are doing well. Any advice with regards to this? Thank you #container { font-family: Arial, Verdana, Tahoma, Helvetica, sans-serif; font-size: 15px; } .district_1 table { font-family: Arial, Verdana, Tahoma, Helvetica, sans-serif; font-size: 15px; } <script type="text/javascript"> $(document).ready(function() { //To hide DISTRICTS & SUBJECTS $('.district_1').hide(); $('#zone_1').click(function() { //check to make sure field is checked if ($(this).attr('checked')) { $('.district_1').fadeIn(400); } else { $('.district_1').fadeOut(400); } }); // end click() }); // end ready() </script> <?php /***North's DISTRICTS***/ echo '<input name="zone[]" type="checkbox" id="zone_1" value="1">'; echo '<span class="zone_text_enlarge"><label for="zone_1">North</label></span><br />'; $dbc = mysqli_connect('localhost', '111', '111', '111') or die(mysqli_error()); $query = ("SELECT * FROM tutor_preferred_district ORDER BY district_id ASC LIMIT 7"); $sql = mysqli_query($dbc, $query) or die(mysqli_error()); echo'<div class="district_1">'; echo'<table><tr>'; // Start your table outside the loop... and your first row $count = 0; // Start your counter while($data = mysqli_fetch_array($sql)) { /* Check to see whether or not this is a *new* row If it is, then end the previous and start the next and restart the counter. */ if ($count % 5 == 0) { echo "</tr><tr>"; $count = 0; } echo '<td><input name="district[]" type="checkbox" id="'.$data['district_id'].'" value="'.$data['district_id'].'"/>'; echo '<label for="'.$data['district_id'].'">'.$data['district_name'].'</label></td>'; $count++; //Increment the count } echo '</tr></table><br/><br/>'; //Close your last row and your table, outside the loop echo '</div>'; [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
The Letter E Posted December 5, 2010 Share Posted December 5, 2010 I think font-family needs to be the last declaration in the styling of your element. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.