Document Type The first line of the page should be the DOCTYPE. Is mandatory. Is to tell the browser what version of HTML is what you use on the page.
\u0026lt;! DOCTYPE HTML PUBLIC "- / / W3C / / DTD HTML 4.01 / / EN" "http://www.w3.org/TR/html4/strict.dtd">
Basic Structure a web
\u0026lt;! DOCTYPE HTML PUBLIC "- / / W3C / / DTD HTML 4.01 / / EN" "http://www.w3.org/TR/html4/strict.dtd">
\u0026lt; ; html> \u0026lt;head> \u0026lt;title>
Title \u0026lt;/ title> \u0026lt;/ head> Content \u0026lt;body>
\u0026lt;/ body>
\u0026lt;/ html>
Title
title
element is most important for a website because they use search engines to index the page. Tags
should be lower case and closed.charset (charset) Your server usually sends the MIME type of document (text / html) and encoding (ISO-8859-1 for English). But, just in case you can specify with this label (within the \u0026lt;head>):
- \u0026lt;meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
- Format \u0026lt;span>
- : To format a few words, without breaking the flow of text.
: To format a few items together, breaking the flow of text (which is allotted to a new line and the entire width of the page.) Margins
- To make the first line of each paragraph is a bit more right, use paragraphs and apply the following style sheet:
- p {text-indent: 20px}
- With this, all paragraphs will have the first line 20 pixels to the right margin. Focus
- To center the content inside an element, just the style text-align: center;. \u0026lt;div
- solid style="border:1px black; width:70%; text-align:center"> This text is centered. \u0026lt;/ Div>
- This text is centered.
- To center the item itself, and not its content, you have to give a width (width), and tell the browser to deal with the margins. It is made with margin-left: auto; margin-right: auto;, or, short: margin: 0 auto;. \u0026lt;div
- solid style="border:1px black; width:70%; margin: 0 auto;"> Centered div \u0026lt;/ div>
- Centered div
- Emphasis \u0026lt;em> label used to mark the words they want to emphasize, and \u0026lt;strong> to give greater emphasis. Browsers usually represent them in italics and bold respectively, but you can change it with CSS.
- To specify a particular style: font-weight: bold
- for bold font-style: italic italics
text-decoration: underline
- for underline text-decoration: overline for a line
- above text-decoration: line-through to strikeout. Lists
- Using CSS for lists (\u0026lt;ul> and \u0026lt;ol>) can make navigation menus, buttons, tabs, tables, etc.
To apply a style to multiple elements at once, invent a name (class) for them, with the attribute classwill help and apply CSS:
, and change the style to all of the classroom while the CSS. For example, in \u0026lt;div>
div.ayuda {border: 2px solid black; background: yellow;}
When you want to style a single element is given an ID with the id attribute, for example
\u0026lt; div id = "title"> . And in the stylesheet:
div # title {border: 12px solid blue; background: gray, color: black;}
If all paragraphs that are within a \u0026lt;div>
are special rather write \u0026lt;p class="especial"> for each paragraph, define the CSS rule as
div p {...........
}, which means all
\u0026lt;p> that are within a \u0026lt;div>
), and put just
\u0026lt;p> in each paragraph. size
text To change text size, use CSS font-size
, not the headers \u0026lt;h1>, \u0026lt;h2> ... Ref:
Making good websites
0 comments:
Post a Comment