In a few words
to define styles in a small part of a page tag is used \u0026lt;span> . With the attribute
style indicate the characteristics of style.
\u0026lt;p> This is a paragraph with some words \u0026lt;span style="color:green"> green \u0026lt;/ span>. \u0026lt;/ p>
This is a paragraph with some words
green.
In one part of the page
To make a label showing any particular style, for example, an entire paragraph, use the style attribute
. \u0026lt;p style="color:#990000">
This is a paragraph red.
\u0026lt;/ p> \u0026lt;p style="color:#000099">
This is a paragraph in blue. \u0026lt;/ p>
This is a paragraph in red.
This is a paragraph in blue. With
\u0026lt;div>
label styles can define an entire block of the page at once. \u0026lt;div style="color:#000099; font-weight:bold">
\u0026lt;h3> \u0026lt;em> These labels are blue and bold \u0026lt;/ em> \u0026lt;/ h3> We
\u0026lt;p>
within the DIV, then remain the ethyl \u0026lt;/ p> \u0026lt;/ div>
These tags are in blue and bold
continue within the DIV, then remain the styles
In full-page
To define styles that are applied to the entire page, use the style
label affixed to the top of the page. Place the name of the tag we want to define styles and curly braces {}
place features styles. \u0026lt;html>
\u0026lt;head>
\u0026lt;title> Page Title \u0026lt;/ title> \u0026lt;style type="text/css">
h1 {text-decoration: underline; text-align :
center} p {font-family: Arial, Verdana; color: white; background-color: black}
body {color: black; background-color: # cccccc; text-indent: 1cm}
\u0026lt;/ style> \u0026lt;/ head> \u0026lt;BODY>
\u0026lt;h1> within the page title \u0026lt;/ h1>
\u0026lt;p> Paragraph text \u0026lt;/ p>
\u0026lt;/ body> \u0026lt;/ html> h1 label be presented underlined and centered. Across the page (label
\u0026lt;body>
) text will be colored black, grayish background color, lateral margin of 1 cm. Applying styles to the tag \u0026lt;body>
, they will be inherited by the other tags of the document, if not re-define these styles in the following labels, in which case the style of the label shall prevail.
In entire website
programming with style sheets allows once, define the style of an entire web site, creating a file where we put the styles of the page and all pages linking to that file. Thus, if we change the file types, change all the pages. Also saved in HTML code, reducing the weight of the document.
process to include styles in an external file. 1 - Create a style file, in text format with the extension
.
css.
2 - We link the style sheet on the website, placing Tag:
\u0026lt;link rel="stylesheet" type="text/css" href="estilos.css"> estilos.css
Being the style file name.
\u0026lt;html>
\u0026lt;head>
\u0026lt;link rel="stylesheet" type="text/css" href="estilos.css">
\u0026lt;title> Page Title \u0026lt;/ title>
\u0026lt;/ head>
\u0026lt;body>
...
\u0026lt;/ body>
\u0026lt;/ html>
also can include styles in an external file with the syntax
@ import url ("style.css")
.
body {background -color: # ffffcc;
should be included between the tags \u0026lt;style type="text/css"> and
\u0026lt;/ style> , which are placed in the file header. Importing CSS file must be written in the first line of the style declaration:
} \u0026lt;/ style>
This method is used when there are some basic guidelines of styles (defined in the file to import) and some specific styles for each page (which are defined between the tabs \u0026lt;/ style> ).
Rules of importance in the hierarchy styles to resolve conflicts between different style declarations for the same portion of a page (from lowest to highest importance in case of contradiction): * Declaration of styles with external file.
* style declaration for the entire page. (Label style at the top of the page)* styles defined in a part of the page. (Div)
* Defined in a specific label. (Tags style attribute) * Declaration of style for a small portion of the document. (Label span)
Web Development
0 comments:
Post a Comment