css nael alian . div.ex { width:220px; padding:10px; border:5px solid gray; margin:0px; } the line...

29
CSS Nael Alian www.w3schools.com

Upload: cornelius-bennett-gibbs

Post on 16-Dec-2015

225 views

Category:

Documents


3 download

TRANSCRIPT

CSSNael Alian www.w3schools.com

<html><head><style type="text/css">div.ex{width:220px;padding:10px;border:5px solid gray;margin:0px;}</style></head>

<body><img src="250px.gif" width="250" height="1" /><br /><br />

<div class="ex">The line above is 250px wide.<br />The total width of this element is also 250px.</div>

<p><b>Important:</b> This example will not display correctly in IE!<br />However, we will solve that problem in the next example.</p>

</body></html>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><style type="text/css">div.ex{width:220px;padding:10px;border:5px solid gray;margin:0px;}</style></head>

<body><img src="250px.gif" width="250" height="1" /><br /><br />

<div class="ex">The line above is 250px wide.<br />Now the total width of this element is also 250px.</div>

<p><b>Note:</b> In this example we have added a DOCTYPE declaration (above the html element), so it displays correctly in all browsers.</p>

</body></html>

<html><head><style type="text/css">p.one {border-style:solid;border-width:5px;}p.two {border-style:solid;border-width:medium;}p.three{border-style:solid;border-width:1px;}</style></head>

<body><p class="one">Some text.</p><p class="two">Some text.</p><p class="three">Some text.</p><p><b>Note:</b> The "border-width" property does not work if it is used alone. Use the "border-style" property to set the borders first.</p></body>

</html>

<html><head><style type="text/css">p{border-style:dotted solid ;}</style></head>

<body><p>2 different border styles.</p></body></html>

The border-style property can have from one to four values.

border-style:dotted solid double dashed; top border is dottedright border is solidbottom border is doubleleft border is dashed

border-style:dotted solid double; top border is dottedright and left borders are solidbottom border is double

border-style:dotted solid; top and bottom borders are dottedright and left borders are solid

border-style:dotted; all four borders are dotted

<html><head><style type="text/css">p{border:5px solid red;}</style></head>

<body><p>This is some text in a paragraph.</p></body></html>

<html><head><style type="text/css">p {border-style:solid;border-top:thick double #ff0000;}</style></head>

<body><p>This is some text in a paragraph.</p></body>

</html>

<html><head><style type="text/css">p {border-style:solid;}p.none {border-bottom-style:none;}p.dotted {border-bottom-style:dotted;}p.dashed {border-bottom-style:dashed;}p.solid {border-bottom-style:solid;}p.double {border-bottom-style:double;}p.groove {border-bottom-style:groove;}p.ridge {border-bottom-style:ridge;}p.inset {border-bottom-style:inset;}p.outset {border-bottom-style:outset;}</style></head>

<body><p class="none">No bottom border.</p><p class="dotted">A dotted bottom border.</p><p class="dashed">A dashed bottom border.</p><p class="solid">A solid bottom border.</p><p class="double">A double bottom border.</p><p class="groove">A groove bottom border.</p><p class="ridge">A ridge bottom border.</p><p class="inset">An inset bottom border.</p><p class="outset">An outset bottom border.</p></body></html>

<html><head><style type="text/css">p {border-style:solid;border-left-width:30px;}</style></head>

<body><p><b>Note:</b> The "border-left-width" property does not work if it is used alone. Use the "border-style" property to set the borders first.</p></body></html>

border-left-width:30px;

border-top-width:30px;