Thursday, August 18, 2011

an example


Hi my friends.
I'm sure everything is OK with you.
Now I'm going to present you several examples of CSS.
Below there are examples which can help us how to put style codes in HTML tags.
Notice please the red-writing lines.

<html>
<head>
<title> one example of CSS</title>
<STYLE TYPE="text/css">
body {
background-color: yellow;
background-position: 2in 2cm;
background-repeat: repeat;
border-bottom-color: #800000;
border-bottom-width: 1cm;
border-left-color: #ff0000;
border-left-width: 1cm;
border-right-color: #ff80ff;
border-right-width: 1cm;
border-style: inset;
border-top-color: #ffff80;
border-top-width: 1cm;
bottom: auto;
cursor: pointer;
display: table-cell;
float: none;
height: auto;
left: auto;
margin: auto;
max-width: 16px;
outline-color: #808040;
outline-style: dotted;
outline-width: 1cm;
position: inherit;
right: auto;
top: auto;
visibility: collapse;
width: auto;
}
</STYLE>
</head>
<body>
</body>
</html>

Try to copy this file  into a text editor and save it as index.html then open it with an internet browser.


<html>
<head>
<title> second method  CSS</title>
<LINK REL=STYLESHEET TYPE="text/css"  HREF="a.css">
<!--   may be used this line too <link href="a.css" rel="stylesheet" type="text/css">-->
</head>
<body>
</body>
</html>

Try to copy this file  into a text editor and save it as index.html
then copy this file

body {
background-color: yellow;
background-position: 2in 2cm;
background-repeat: repeat;
border-bottom-color: #800000;
border-bottom-width: 1cm;
border-left-color: #ff0000;
border-left-width: 1cm;
border-right-color: #ff80ff;
border-right-width: 1cm;
border-style: inset;
border-top-color: #ffff80;
border-top-width: 1cm;
bottom: auto;
cursor: pointer;
display: table-cell;
float: none;
height: auto;
left: auto;
margin: auto;
max-width: 16px;
outline-color: #808040;
outline-style: dotted;
outline-width: 1cm;
position: inherit;
right: auto;
top: auto;
visibility: collapse;
width: auto;
}
and save it as a.css  then locate these two files in same dirrection.
After, open the index.html with an internet browser.
(Some browsers may present different appearance.)
In this way you can create any css file for a lot of pages using a linking.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.