![]() |
#1
|
|||
|
![]() Hey y'all, I decided not to bump my old thread as it got kind of derailed. I just had a couple simple questions regarding HTML5 and website layout.
1. From what I gather - HTML is for setting up different sections of a website, and CSS gives them their looks. With a website like this for instance: HTML Code:
<!DOCTYPE html> <html> <head> ****** charset="utf-8" /> <title>Title</title> <link href="css/html5reset.css" rel="stylesheet" /> <link href="css/style.css" rel="stylesheet" /> </head> <body> <header> <hgroup> <h1>Header in h1</h1> <h2>Subheader in h2</h2> </hgroup> </header> <nav> <ul> <li><a href="#">Menu Option 1</a></li> <li><a href="#">Menu Option 2</a></li> <li><a href="#">Menu Option 3</a></li> </ul> </nav> <section> <article> <header> <h1>Article #1</h1> </header> <section> This is the first article. This is <mark>highlighted</mark>. </section> </article> <article> <header> <h1>Article #2</h1> </header> <section> This is the second article. These articles could be blog posts, etc. </section> </article> </section> <aside> <section> <h1>Links</h1> <ul> <li><a href="#">Link 1</a></li> <li><a href="#">Link 2</a></li> <li><a href="#">Link 3</a></li> </ul> </section> </aside> <footer>Footer - Copyright 2011</footer> </body> </html> I.E: - How would I center the header, (and would a border be done with CSS) ? - How could I put the nav bar under the header - In general, what commands should I use to put different sections in diff places The site I began with turned out like this - my main issues of not being able to move the nav bar around and the body text not fitting in the border being the big problems. HTML Code:
<!DOCTYPE html> <html> <head> ****** charset="utf-8"> <!--[if lt IE 9]> <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <title> BTS </title> <style> html, body { margin: 0px; padding: 0px; border: 0px } body { background-color: white } article { margin: 20px; padding: 15px; border: 2px solid black;float: left; width:60%; } footer { clear:both; background-color: silver; border:5px solid black; text-align:center; } * { margin: 0; } html, body { height: 100%; } .article { style="margin-left:150px"; border:2px solid black; } .wrapper { min-height: 100%; height: auto !important; height: 100%; margin: 0 auto -4em; } .footer, .push { height: 4em; } .b { border:5px solid black; text-align: center; background-color: silver; } .field { border:2px solid black; text-align: center; background-color: silver; } .nav { background-color: silver; border: 2px solid black; margin: 10px; padding: 10px; width:150px;float:left; } </style> </head> <body> <div class="wrapper"> <header class="b"> <h1 style="border: 5px solid black"> BTS </h1> <h2 style="border: 2px solid black"> Your technology support resource! </h2> </header> <nav class="nav"> <fieldset class="field"><a href="BTSMain.html"><b>Home</b> </a></fieldset> <fieldset class="field"><a href="BTSServices.html"><b>Services We Offer</b></a></fieldset> <fieldset class="field"><a href="BTSAboutUs.html"><b>Request Service</b></a></fieldset> <fieldset class="field"><a href="BTSTestPage.html"><b>Contact Us</b></a></fieldset> <fieldset class="field"><a href="BTSTestPage2.html"><b>About BTS</b></a></fieldset> </nav> <article class="article"> VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV </article> <div class="push"> </div> </div> <div class="footer"> <footer> <h1> <a href="BTSAboutUs.html"><b>About Us</b></h1> </footer> </div> </body> Thanks in advance, and /flame on [You must be logged in to view images. Log in or Register.] | ||
Last edited by EchoedTruth; 02-05-2013 at 04:56 PM..
|
|
#2
|
|||
|
![]() Yer missing the point of css
the css stylesheet is the layout, page colors, font characteristics, everything. The pages are jsut some html that fill the layout in. For instance, in the css stylesheet, you have something like your header box: HTML Code:
.header { margin-top: 20px; margin-bottom: 20px; border: 1px solid black; float: center; width: 1000px; text-align: center; background-color: white; color: black; height: 30px; direction: ltr; font-family: Arial,"Microsoft Sans Serif",sans-serif; font-stretch: normal; font-style: normal; vertical-align: text-middle; } HTML Code:
<div class="header"> <h1>whatever the fuck you want in the header box</h1> </div> Then the html page calls that component with the div tags and puts the text in. Go look at the post I made on the other thread that had both stylesheet and page on the same file. Separate those from about the div wrapper open tag. Those would be the page and stylesheet separated. If I'm making a one-page site, I just put them together like I did in that file. You need them separated. Can I suggest your buttons go along the top? | ||
Last edited by Nuncio; 02-05-2013 at 10:01 PM..
|
|
#3
|
||||
|
![]() Quote:
| |||
|
#5
|
|||
|
![]() You'd make .button, define its size, bg color and text.
Make a .topbar, define it's width and height. You'd div the buttons inside the .topbar div. taken from the other single page css/html thing I posted for you in the other thread. I defined the box called lef1, and the buttons in the style area HTML Code:
.left1 { border: 0px solid black; float: left; width: 170px; text-align: center; height: 306px; background-color: red; color: black; background-position: center center; direction: ltr; font-family: Arial,"Microsoft Sans Serif",sans-serif; font-size: normal; font-stretch: normal; font-style: normal; font-variant: normal; } .button { border: 1px solid black; margin: 5px; float: center; width: 159px; text-align: center; background-color: red; color: black; height: 35px; background-position: center center; direction: ltr; font-family: Arial,"Microsoft Sans Serif",sans-serif; font-size: large; font-stretch: normal; font-style: normal; font-variant: normal; vertical-align:text-bottom -moz-border-radius: 7px; border-radius: 7px; } HTML Code:
<div class="left1"> <div class="button"> button 1 </div> <div class="button"> button 2 </div> <div class="button"> button 3 </div> <div class="button"> button 4 </div> <div class="button"> button 5687565 </div> </div> | ||
Last edited by Nuncio; 02-06-2013 at 11:11 AM..
|
|
#6
|
||||
|
![]() Quote:
Thank you for the pointers [You must be logged in to view images. Log in or Register.] ... I'm more aiming to teach myself web design than to have something built for me. | |||
|
#7
|
|||
|
![]() | ||
|
#8
|
|||
|
![]() Thanks Alovia! Good stuff
| ||
|
![]() |
|
|