Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,753 members, 7,820,606 topics. Date: Tuesday, 07 May 2024 at 06:00 PM

How To Style A Div Element - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / How To Style A Div Element (854 Views)

Importance Of Div Tags / How To Do Vertical Alignment With Div-based Layouts / Enough Of Table Based Layouts: Time To Migrate To Css-div Layouts (2) (3) (4)

(1) (Reply) (Go Down)

How To Style A Div Element by dansmog(m): 10:22am On Apr 06, 2012
pls for my first text in web dev. a homepage with; header, nav, sidebar $ footer. how can i place them correcrtly. they are all in <div>. THANKS
Re: How To Style A Div Element by yawatide(f): 12:38pm On Apr 06, 2012
Maybe something like this (Note: I won't go into details of css or how to code a navigation menu or set widths. You will need to figure tha tout on your own):
<div id="container">
<div id="header">Header</div>
<ul id="navigation">
<li>menu item 1</li>
<li>menu item 2</li>
<li>menu item 3</li>
</ul>
<div id="content">
<div id="sidbar" style="float: left;">side bar contents</div>
<div id="main" style="float: right;">main content area</div>
<br style="clear: both;" />
</div>
<div id="footer">footer</div>
</div>


phew!
Re: How To Style A Div Element by dansmog(m): 12:57pm On Apr 06, 2012
thanks @yawatide, bt if am to put the nav at the top, can i use the position:absolute;top:zpx or z% whatever it will work right? thanks
Re: How To Style A Div Element by ooshekeen: 1:00pm On Apr 06, 2012
I am a web developer for over 7years and if you really want to find answers to your question, get the CSS3 ebook to learn all the stuff you possibly can....

I will recommend you get for yourself the CSS3 ebook by going to www.facebook.com/cyberma3x

Don't wait around any more.....

Send an email to books@cyberma3x.com to learn more

smiley
Re: How To Style A Div Element by yawatide(f): 8:19pm On Apr 06, 2012
OP,

I am not a fan of positioning. It can be done but it gets tricky. Just lay it out as I have specified and you should be fine. Better yet, do what I did when I was starting out - go to a site you like and save out the complete page. Then analyze the underlying code and modify to see what will happen. With time, you will be able to branch out on your own and write your own code.

good luck!

1 Like

Re: How To Style A Div Element by dansmog(m): 9:26pm On Apr 06, 2012
do you know how i can get the css code of a website just like how they get the html code.@yawatide i do that, i have the code for www.1kjobsonline.com
Re: How To Style A Div Element by doncigalo: 12:11pm On Apr 07, 2012
@op using google chrome u right click on the page, click on view source. Once u've done this u shud be able to view the source code of the page, if u want to view the external CSS files that was used simply click on the css link and google chrome will open up the css file in another tab for u.

1 Like

Re: How To Style A Div Element by dansmog(m): 12:30pm On Apr 07, 2012
thanks bt am using FF and IE
Re: How To Style A Div Element by yawatide(f): 1:03pm On Apr 07, 2012
^^^ Same difference.

(1) (Reply)

The Duo Peter And Paul (psquare ) Loses Their Mother To A Heart Illness / Anybody Who Can Code Smtin Like Webmallng? / 9 Craziest Things That Happen When You Google.

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 12
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.