1 / 13

C ascading S tyle S heets

C S S. C ascading S tyle S heets. Properties - Position. position absolute, relative top <length>, <percentage>, auto left <length>, <percentage>, auto Z-index <number>, auto. X. (0,0). Y. Positioning. Upper left corner corresponds to (0,0)

howeb
Download Presentation

C ascading S tyle S heets

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. C S S Cascading Style Sheets

  2. Properties - Position • position • absolute, relative • top • <length>, <percentage>, auto • left • <length>, <percentage>, auto • Z-index • <number>, auto

  3. X (0,0) Y Positioning • Upper left corner corresponds to (0,0) • The value of top, bottom, right, leftcan be expressed in: • Length (measured in px, em, etc…) • Percentage of the parent’s width

  4. The z-index • stacking order is called the z-index. • If elements overlap each other, the one with the higher z-index appears on top. • Example: .topElement {position: absolute; z-index=2; top:0px; left:0px; font-size:36pt; color:red}

  5. X (0,0) Y CSS Examples: • <h1 style="color: white; position: absolute; bottom: 50px; left: 50px; z-index: 2"> Text in front.</h1> • Positioning: Example • Stacking: Example • Shadowing: Example

  6. Using Boxes and Positioning for layout

  7. In a box: • Margins are always transparent. • Borders come in various styles. • Background settings: • the area just inside the borders • includes both the padding and content areas.

  8. Examples img { border-style: ridge; border-width: 20px; border-color:red green blue purple} h1 {background-color: #CC66FF; width: 50%; padding: 20px} H1,50% ,purple background

  9. Border values

  10. Backgrounds • background-color • Hex • background-image • URL(image.jpg) • background-repeat • No-repeat, repeat-x, repeat-y • background-attachment • Fixed, scroll • background-position • Top, left • p { background-position: 70px 10px; background-repeat: repeat-y; background-image: url(background.gif) } Example

  11. Background repeat examples:

  12. Link Style • a:link {color: #FFFFFF; text-decoration: none} • a:visited {color: #808080; text-decoration: none} • a:hover {color: red; text-decoration: none}

  13. Linked CSS example: • You can download these and try on your own! • One html file: css_files/htmlcss7.htm • The external stylesheet: • css_files/stylecss.css • The html file can call any stylesheet one at a time for a different design each time.

More Related