October 29, 200817 yr hi, its my 1st time writing css and xhtml. (I built this within IE7) ive made 2 divs that should be positiond left and right. both next to each other. but for some reason my right div appears to the right - but drops below the left div??? please help! The div's are called: content_nav (left hand div) and content_textbody (right hand side) Also, How do i align the sitemap (within the footer div) to 'center'?? css or in the xhtml?? Also, When viewed in IE7 its fine. But in FireFox 3 and Navigator it renders totally wrong?? Please help! thanks index.html bhps.css
October 29, 200817 yr hi welshhuw you seem to have got your divs a little messed up here! you have placed the "content_textbody" body inside of "content_nav": "content_nav" should be closed before starting "content_textbody" starts. you have also done a similar thing with the content and footer divs your code should look something like: <div class="content"> <div class="content_nav"> nav menu here </div> <div class="content_textbody"> bodytext here </div> </div> <div class="footer"> footer content here </div> Also you have have a div with a class name of "navmenu ul" you can't use classes like this I think what you are trying to do is have a div with the classname "navmenu" and giving the <ul> element some css attributes you do not need to add "ul" to the classname I suggest you check out w3schools for reference with your css. This should set you on your way at least and you should find floating the divs much easier now Cheers Ysuran
October 30, 200817 yr Author So I should have used 'class' instead of 'id' ?? (For all of my DIV's.) Is that right?
October 30, 200817 yr So I should have used 'class' instead of 'id' ?? (For all of my DIV's.)Is that right? You can use ethier it doesn't matter personal preference. Edit:Better explained by Dizi
October 30, 200817 yr Ids are used if you are only using them once on a page, as they are unique identifiers. for example a wrapper, header, footer these would really only be used once on a page if you have multiple instances of something, for example all your images are in image boxes, then you would use classes, as these are for use if you are using the same thing more that once on a page. Here is a quick example: <div id="header"> Header stuff here</div> <div id="main"> <div class="styleone"></div> <div class="styetwo"></div> <div class="styleone"></div> <div class="styletwo"></div> </div> <div id="footer">Fotter stuff here</div> Hope that makes sense
October 30, 200817 yr Sorry that wasn't the point I was trying to make! It's just the way I code - using classes for css layouts and using ids when I intend to do some javascript wizardry! What I was trying to say was the layout of the divs was actually incorrect you have divs such as "content_textbody" inside of "content_nav" and they should be side by side
October 30, 200817 yr Author <div class="content"> <div class="content_nav"> nav menu here </div> </div> <----------------------------------i added this end /div tag here and it works!! <div class="content_textbody"> bodytext here </div> </div> <div class="footer"> footer content here </div> Not sure if it should work like that tho but it also works in FF and Netscape now.
October 30, 200817 yr <div class="content"><div class="content_nav"> nav menu here </div> </div> <----------------------------------i added this end /div tag here and it works!! <div class="content_textbody"> bodytext here </div> </div> <div class="footer"> footer content here </div> Not sure if it should work like that tho but it also works in FF and Netscape now. You should take one of the </div> out from under where it says bodytext here if that is the case as you are now closing more div's then you have open.
October 30, 200817 yr Author dizi - spotted that when i validated it with W3C. Thanks for your help. still cant get the sitemap: links to center tho?? how should i do this?
Create an account or sign in to comment