Thứ Tư, 15 tháng 7, 2015

bai4: CSS

                                  CSS

CSS what is

Css:Cascading StyleSheets.

-used to describe the appearance and formatting of  HTML
-There are two main reasons for separating orm/formatting (CSS) from your functional content/structure (HTML):
+You can apply the same formatting to several HTML elements without rewriting code (e.g.style="color:red":) over and over
<link type="text/css" rel="stylesheet" href="stylesheet.css
+you can apply similar appearance and formatting to several HTML pages from a single CSS file

CSS systax:

selector{

property:value;
}
selector can be any HTML element, such as <p><img>, or <table>
value is a possible setting for color,font-family;
Another cool advantage of CSS is that you can set many properties for one selector. 
ex p{
color:
font-family:
}
it's important to remember to put a semicolon (;) at the end of each line.

*Commen

systax/*aaaaaaaaaa*/
Hexawhatnow?
-Hexadecimal counting is base-16. Each digit can be the numbers 0 through 9or the letters a through f
-Hex values always start with a pound sign (#), are up to six "digits" long, and are case-insensitive.
Pixels and ems
-When we've asked you to adjust font size,you should use px or em
ex: p{
    font-size:10px;
}
Backup values
p{
font-family:Tahoma,verdana,sans-serif;
}
CSS will first try to apply Tahoma to your paragraphs. If the user's computer doesn't have that font, it will try Verdana next, and if that doesn't work, it will show a default sans-serif font.
Background color, height, and width
-background-color:color of your block,you set to a color or hex value
-height:about height of paragrap  you set to a value in pixels
-width:about width of paragrap     you set to a value in pixels or em.
Bordering on insanity
Many HTML elements support theborder property. This can be especially useful with tables.
The border property in turn supports several values.  example
selector{
border:2px solid red;
}
Links and text decoration
-Links have a lot properties as font, color, size, and so on.
-But links also have a property, text-decoration, that you can change to give your links a little more custom flair. You're probably used to seeing links that are blue and underlined, right


Không có nhận xét nào:

Đăng nhận xét