Вы находитесь на странице: 1из 7

1

INTERNAL STYLE SHEET: CODING: <html> <head> <title>Internal Style Sheet Example</title> <style> <!-body { background: #C9F1C5 } h1 { color: #54B24B; font: bold 14px Verdana, Arial, Helvetica } p { font: 12px Verdana, Arial, Helvetica } --> </style> </head> <body> <CENTER><FONT SIZE="+3"> ABOUT INTERNAL STYLE SHEET</font></center> <hr> <h1>Page With an Internal Style Sheet</h1> <P><B>Internal style sheets are styles that are placed in the head of the HTML document. <BR> These styles affect only the document they are in, and cannot be referenced by any other Web document. <p>This page contains style definitions at the top of the HTML code.</p> </body> </html>

EMBEDDED STYLE SHEET

<html> <head> <title>embedded</title> <style type="text/css"> <!-body{background:skyblue; color:red ; margin:0.5in;font size:20;} --> </style> </head> <body> <h1><center>EMBEDDED STYLE SHEET</h1><center> <hr> The STYLE element embeds a style sheet in the document. <br> Any number of STYLE elements may be contained in the HEAD of a document.<br> The required TYPE attribute of STYLE is used to specify the Internet media type of the style language.<br> For Cascading Style Sheets, the TYPE attribute value should be text/css. The optional TITLE attribute gives a title for the style sheet. <br> Without a TITLE attribute, the style sheet is always applied when style sheets are enabled. <br> With a TITLE attribute, the style sheet is automatically applied but the user may choose to disable the style sheet while keeping or enabling other style sheets. Style sheets with the same title are considered to be the same style sheet. <hr width="75"> <P> </ul> </body> </html>

EXTERNAL STYLE SHEET .CSS H1 { font-family: 'Times New Roman'; font-size: 36px; background: red; color: WHITE; } H2 { font-family: arial,verdana,sans-serif; font-size: 20px; background: YELLOW; color: RED; } H3 { font-family: arial,verdana,sans-serif; font-size: 20px; background: LIME; color: GREEN; } P{ font-family: arial,verdana,sans-serif; font-size: 16px; background:blue; color: GREEN; }

.HTML <html> <head> <title>EXTERNAL</title> <link rel="stylesheet" type="text/css" href="main.css"> </head> <body> <center><h1>ABOUT EXTERNAL STYLE SHEET</h1></center> <p><h2>An external style sheet is ideal when the style is applied to many pages. <br> With an external style sheet, you can change the look of an entire Web site by changing one file.<br> Each page must link to the style sheet using the link tag. The link tag goes inside the head section.<br></h2> <H3>An external style sheet can be written in any text editor. The file should not contain any html tags. <br> Your style sheet should be saved with a .css extension. </H3> </body> </html>

Вам также может понравиться