HTML/CSS/Box Model/border top
Содержание
- 1 border-top: 1px solid #003
- 2 border top one value
- 3 border-top shortcut: 10px solid black;
- 4 This is a header
- 5 border top style color
- 6 Independently set border-left, border-right, border-top, and border-bottom.
- 7 The top border of this paragraph has a medium width and the color specified for text
- 8 The top border of this paragraph has is 1 pixel width, solid and black.
- 9 The top border of this paragraph is of medium thickness.
- 10 Top border a medium width and the color specified for text.
- 11 top border of this paragraph is the same color as the text color
border-top: 1px solid #003
<source lang="html4strict">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <style type="text/css">
- navsite ul li {
margin: 0; border-top: 1px solid #003;
} </style> </head> <body id="pagespk">
</body> </html>
</source>
border top one value
<source lang="html4strict">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html> <head> <title></title> <style type="text/css"> p { border-top: solid; } </style> </head> <body>
This is a test. This is a test.
</body> </html> </source>
border-top shortcut: 10px solid black;
<source lang="html4strict">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>border-top shortcut: 10px solid black;</title> <style type="text/css"> h2 {
border-top: 10px solid black;
} </style> </head> <body>
This is a header
This is a test
</body> </html>
</source>
border top style color
<source lang="html4strict">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html> <head> <title></title> <style type="text/css"> p { border-top: solid black; } </style> </head> <body>
This is a test. This is a test.
</body> </html> </source>
Independently set border-left, border-right, border-top, and border-bottom.
<source lang="html4strict">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <style type="text/css"> .container{
position: relative; width: 800px; height: 800px; background: pink;
}
- .box {
float: right; overflow: auto; visibility: visible; width: auto; height: 100px; margin: 10px; padding: 10px; background: red;
}
- .small {
position: absolute; border-left: 10px dotted black; background: yellow;
} </style> </head> <body>
this is a test. this is a test. this is a test.
</body> </html>
</source>
The top border of this paragraph has a medium width and the color specified for text
<source lang="html4strict">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html> <head> <title></title> <style type="text/css"> p { border-top: solid; } </style> </head> <body>
This is a test. This is a test.
</body> </html> </source>
The top border of this paragraph has is 1 pixel width, solid and black.
<source lang="html4strict">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html> <head> <title></title> <style type="text/css"> p { border-top: 1px solid black; } </style> </head> <body>
This is a test. This is a test.
</body> </html> </source>
The top border of this paragraph is of medium thickness.
<source lang="html4strict">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html> <head> <title></title> <style type="text/css"> p { border-top: solid black; } </style> </head> <body>
This is a test. This is a test.
</body> </html> </source>
Top border a medium width and the color specified for text.
<source lang="html4strict">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html> <head> <title></title> <style type="text/css"> p { border-top: solid; } </style> </head> <body>
This is a test. This is a test.
</body> </html> </source>
top border of this paragraph is the same color as the text color
<source lang="html4strict">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html> <head> <title></title> <style type="text/css"> p { border-top: thin solid; } </style> </head> <body>
This is a test. .
</body> </html> </source>