ashrobbins87 Posted May 20, 2009 Share Posted May 20, 2009 I have just finished commenting about 80 pages worth of code for my uni project, and now all of my divs are not aligning the way they should be according to the CSS. The css states that the main page content should be in a div called div.test which was all displaying fine and centrally before I commented, now it is going to the left of the page. I cant see anything wrong with the comments or any comments that are unclosed. Could someone please take a look and see if a fresh pair of eys can help me out?? <!-- Author: Ashley Robbins Date last modified: 08/05/09 Page Description: --> Quote Link to comment https://forums.phpfreaks.com/topic/158950-whats-wrong-with-my-divs/ Share on other sites More sharing options...
wildteen88 Posted May 20, 2009 Share Posted May 20, 2009 Just posting the code for the comment wont help . We'll need to see your HTML/CSS has and if possible a live demonstration of your issue. Moving to HTML Help Quote Link to comment https://forums.phpfreaks.com/topic/158950-whats-wrong-with-my-divs/#findComment-838312 Share on other sites More sharing options...
ashrobbins87 Posted May 20, 2009 Author Share Posted May 20, 2009 Dammit I tried posting the whole file not just the comment..... /* CSS Document Author: Ashley Robbins Date last modified: 08/05/09 Page Description: This is the css file for the front end of the website */ /*setting link colours*/ a:link {text-decoration: none; color:#FF6600} a:visited {text-decoration: none; color:#FF6600} a:hover {text-decoration: underline; color: #FF6600;} a:active {text-decoration:none; color:#FF6600} a.speciallink {text-decoration: none; color:#FF6600} a:link.toolbar {text-decoration: none; color: white} a:visited.toolbar {text-decoration: none; color: white} a:active.toolbar {text-decoration:none; color: white} a.speciallink.toolbar {text-decoration: none; color: white} a:link.calendar {text-decoration:none; color:black} a:visited.celendar {text-decoration:none; color:black} a:active.calendar {text-decoration:none; color:black} a.speciallink.calendar {text-decoration:none; color:black} /*button background colour */ over.btnav { background-color: white;} /*setting size and colours of headings */ h1{ font-size:30px; color:#FF6600; font-family:Arial, Helvetica, sans-serif} h2{ font-size:18px; color:#000000; font-family:Arial, Helvetica, sans-serif} h3{ font-size:14px; color:#FF6600; font-family:Arial, Helvetica, sans-serif} h4{ font-size:20px; color:#FF6600; font-family:Arial, Helvetica, sans-serif} h5{ font-size:14px; color:#000000; font-family:Arial, Helvetica, sans-serif} h6{ font-size:16px; color:#FF6600; font-family:Arial, Helvetica, sans-serif} /*setting font for body text */ body{font-family:Arial, Helvetica, sans-serif} /*image border colour */ img.small {border-color:#FF6600;} /*setting background image for totaliser */ img.totaliser{background-image:url(totaliser.php);} img.totaliservertical{background-image:url(totalisertest.php);} /*div to hold page contents centralised */ div.test { width : 1000px; margin-left: auto; margin-right: auto; margin:0px; margin:auto; position:relative; } /*div for calendar on events page */ div.events { height:500px; width:650px; margin:0px; margin:auto; position:absolute; left:12px; align:left; top: 82px; } /*div for small stories in archive */ div.archive { width:500px; margin:0px; margin:auto; left:0px; align:left; position:absolute; } /*div for links on parents page */ div.parentslinks{ width:500px; margin:0px; margin:auto; left:0px; align:left; } /*div to display staff details centrally on page */ div.staff { height:700px; width:600px; margin:0px; margin:auto; } /*div to display facilities centrally */ div.facilities { width:800px; margin:0px; margin:auto; } /*div to show latest events on right of page */ div.latestevents { height:350px; width:330px; margin:1px; margin:auto; border-color:#FF6600; border-left-style:solid; border-left-width:thin; position:absolute; right:0px; margin-top:40px; align:right; padding-left:10px; } /*div for body text on home page */ div.forhometext{ height: 250px; width:500px; margin:auto: } /*div for recent donations on fundraising news page */ div.fordonations{ height: 400px; width:230px; border-color:#FF6600; border-left-width:thin; border-left-color:; border-left-style:solid; padding-left:10px; } /*formatting background and colour of submit form buttons */ input.submit { font-family:Arial, Helvetica, sans-serif; font-size:16px; color:#FF6600; background-color:#FFFFFF; margin-left:0px; border-width:0; cursor:pointer; } td.parentslinks{ padding-left:20px; } #wrapper {margin:0; margin:auto; width : 1000px;} /*setting up elements for rounded bordered divs */ .bl{background: url(Static_Images/bl.gif) 0 100% no-repeat; width: 15em;} .br {background: url(Static_Images/br.gif) 100% 100% no-repeat} .tl {background: url(Static_Images/tl.gif) 0 0 no-repeat} .tr {background: url(Static_Images/tr.gif) 100% 0 no-repeat; padding:10px} .t {background: url(Static_Images/dot.gif) 0 0 repeat-x; width: 15em} .b {background: url(Static_Images/dot.gif) 0 100% repeat-x} .l {background: url(Static_Images/dot.gif) 0 0 repeat-y} .r {background: url(Static_Images/dot.gif) 100% 0 repeat-y} Quote Link to comment https://forums.phpfreaks.com/topic/158950-whats-wrong-with-my-divs/#findComment-838320 Share on other sites More sharing options...
wildteen88 Posted May 20, 2009 Share Posted May 20, 2009 Need the HTML as well to make sense of your CSS. You may be better of posting a link to a live page which shows the problem you're having. Quote Link to comment https://forums.phpfreaks.com/topic/158950-whats-wrong-with-my-divs/#findComment-838335 Share on other sites More sharing options...
ashrobbins87 Posted May 20, 2009 Author Share Posted May 20, 2009 I dont have a live page as its all been developed on Apache on my laptop. I can post the code for a page using the css if that helps? Its pretty big though.... Quote Link to comment https://forums.phpfreaks.com/topic/158950-whats-wrong-with-my-divs/#findComment-838349 Share on other sites More sharing options...
TheFilmGod Posted May 21, 2009 Share Posted May 21, 2009 Download firebug and quickly debug the problem yourself. No human will beat the speed and accuracy of the machine. Quote Link to comment https://forums.phpfreaks.com/topic/158950-whats-wrong-with-my-divs/#findComment-838586 Share on other sites More sharing options...
bananababe Posted May 21, 2009 Share Posted May 21, 2009 I just tried to validate with w3c css validator and there are problems with your styles - there is no css style called "align:left". Use "text-align: left;" your div.forhometext has a colon instead of a semi-colon. there are others as well. Download the web developers toolbar for firefox and go to tools > validate css and it will line item any errors. Quote Link to comment https://forums.phpfreaks.com/topic/158950-whats-wrong-with-my-divs/#findComment-838972 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.