Professional Documents
Culture Documents
Each day you will learn how to make a website with latest web standards by following simple step by step instructions. et!s get started"
Using Tab$es
. simple way of creating layouts is by using the HT% 4table5 tag. %ultiple columns are created by using 4di/5 or 4table5 elements. 6sing 4table5 to create a nice layout is 7OT the correct use of the element. The purpose of the 4table5 element is to display tabular data. The following e'ample uses a table with - rows and 8 columns 9 the first and last row spans both columns using the colspan attribute3
<!DOCTYPE html> <html> <body> <table width=" !!" border="!"> <tr> <td cols"an="2" style="bac$%ro&nd'color:())* !!+"> <h,>-ain Title o. /eb Pa%e<0h,> <0td> <0tr> <tr> <td style="bac$%ro&nd'color:())D1!!+width:,!!"#+"> <b>-en&<0b><br> 3T-4<br> C55<br> 6ava5cri"t <0td> <td style="bac$%ro&nd'color:(EEEEEE+hei%ht:2!!"#+width:7!!"#+"> Content %oes here<0td> <0tr> <tr> <td cols"an="2" style="bac$%ro&nd'color:())* !!+te#t'ali%n:center+"> Co"yri%ht 8 /95chools:com<0td> <0tr> <0table> <0body> <0html> Yo& sho&ld ta$e a loo$ at the 3T-4 T&torial on /9C 5chools i. yo& thin$ yo& need a little more &nderstandin% o. 3T-4 ; 3T-4 attrib&tes: <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
The Doctype Declaration The first item to appear in the source code of a web page is the doctype declaration. This pro/ides the web browser &or other user agent( with information about the type of markup language in which the page is written$ which may or may not affect the way the browser renders the content. )t may look a little scary at first glance$ but the good news is that most WY*)WY+ web editors will create the doctype for you automatically after you!/e selected from a dialog the type of document you!re creating. )f you aren!t using a WY*)WY+ web editing package$ you :ust write 4";OCTY<E html5 at the top line of e/ery
<im% width="77" hei%ht="77" src="htt":00www:w9:or%02!!=0site0ima%es0theme'web'semantics" alt="theme5emantic/eb" 0> <.i%ca"tion>/9C 5emantic /eb<0.i%ca"tion> <0.i%&re> <0aside> <.ooter>)ooter *rea' Co"yri%ht 2!,9<0.ooter> <0body> <0html>
2222222222222222222222222222222222222222222222222222222222222222222 The good and time9sa/ing thing is$ we do not need to include any more self9closing tags like in =HT% drafts &there were many elements labelled self9closing(. >or e'ample$ to create a meta keywords tag you would use 4meta name?@keywords@ content?@HT% 0$C**-$Aa/a*cript@ B5 without the need for a closing 4Bmeta5 elsewhere. #ut now writing it as 4meta name?@keywords@ content?@HT% 0$C**-$Aa/a*cript@5 is completely /alid. Yet$ you can still use the pre/ious one. 2222222222222222222222222222222222222222222222222222222222222222222 Okay$ so that was the basic structure of our website. .s we said before$ in HT% 0$ there are new semantically rich elements that can con/ey the purpose of the element to both de/elopers and browsers. Here are some of the new semantic elements in HT% 03 article aside figcaption figure footer header hgroup mark na/ section time To clarify some points$ let1s talk about our page areas. Headers and footers are pretty self9e'planatory. The na/ element can be used to create a na/igation or menu bar. You can use sections and articles to group your content. The aside element can be used for secondary content. >or e'ample$ as a sidebar of related links. The mark element allowed me to highlight or mark some important te't. >inally$ the figure and figcaption elements specified
a figure in my content &like an image$ diagram$ photo$ code snippet$ etc.( and let us associate a caption for that figure. *o what we really need now is some C** for that code to make our website look awesome"
'hat is &SS(
&SS stands for &ascading Style Sheets *tyles define how to disp$ay HT% elements *tyles were added to HT% E.F to so$!e a prob$em #xterna$ Sty$e Sheets can sa/e a lot of work E'ternal *tyle *heets are stored in &SS )i$es. The synta' of C** will show how to interpret the C** lines$ thanks to W-C G
#asically a selector is selecting the HT% tag that we want to work on$ then we declare which /alue we want to gi/e to a property of that HT% tag. 7ot so hard$ rightH et1s take a look at how the website looks only with those HT% codesG
You see$ all the things are displayed as a block. This is the default beha/iour of HT% . .fter adding some basic C**$ you can see this looks pretty much better.
te#t'ali%n:center+ A aside ? 0@3ere we .loated aside to the ri%ht@0 .loat:ri%ht+ width:,=:1 !em+ A aside &l ? list'style'ty"e:none+ A aside &l li a? te#t'decoration:none+ color:(b.!bCd+ A.ooter ? clear:both+ te#t'ali%n:center+ A
*o we ha/e co/ered how to create the basic structure of a website by using the latest /ersion of HT% which is HT% 0 and used C**- to add some style to our website. >eel free to lea/e a comment if you ha/e any thoughts or ,uestions. )n the ne't article of How to Create Your Own Website Tutorial$ we will work onG .dding interacti/ity by using Aa/a*cript$ Creating rich content with HT% 0 I C**-.
%ore on www.designcodeli/e.com