1 / 12

Cascaded style sheets

Cascaded style sheets. CSS. Placement des styles ( 3 possibilités ). < head > < link rel = 'stylesheet' type = 'text/css' href = 'mon_style.css'/> < style type = 'text/css'> p { font-weight:bold; color:gray; } </ style > </ head > < body >

herman-neal
Download Presentation

Cascaded style sheets

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. Cascaded style sheets CSS

  2. Placement des styles(3 possibilités) <head> <linkrel='stylesheet'type='text/css'href='mon_style.css'/> <styletype='text/css'> p { font-weight:bold; color:gray; } </style> </head> <body> <imgsrc="image.gif"style="position:absolute"/> </body> 1 2 3

  3. Styles ul { font-size: 120% } ul.commerce { font-weight: bold; } ul#pub { color: red; } .commerce { border-color: blue; } #pub { text-align: center; } ul span { visibility: hidden; } <ul> <li> </li> </ul> <ul class="commerce"> . . . <ul id="pub"> . . . <ul> <li> <span> </span> </li> <ul> http://www.w3schools.com/css/css_reference.asp

  4. Types d’éléments Block elements <address> <blockquote> <div> <fieldset> <h1> — <h6> <hr> <legend> <p> <pre> <ul>, <ol>, <li>, <dl> and <dd> Inline elements <a> <span> <i> <b> . . . Tables Un élément inline ne peut pas contenir un élément block <span style="display:block">aa</a> // devient block <li style="display:inline">bb</li> // devient inline

  5. Blocs flottants <style>        .dropcap{            float: left;            width: .7em;            font-size: 5em;            margin-top:3px;            line-height:70%;        }</style> <p><imgsrc="parcel.GIF"style="float:left"><spanclass="dropcap">C</span>et         exemple montre comment commencer un         paragraphe par une grande lettre, ce qui fait         de jolis textes. </p>

  6. Positions static normale relative absolute fixed p.r. fenêtre <div>-- (positionné par les éléments précédents)<imgsrc="http://lti.epfl.ch/LemanOS/Images/titre.png" style="position:relative;top:20px;left:20px;"/><imgsrc="parcel.gif" style="position:absolute;top:20px;left:20px;/></div>

  7. Positions static normale relative absolute fixed p.r. fenêtre (positionné par style) <divstyle="position:absolute;top:100px;left:100px;border: solid 1px">aa<imgstyle="position:absolute;top:10px;left:10px;"src="http://lti.epfl.ch/LemanOS/Images/titre.png"/></div>

  8. Positionnements dans un élément absolute p.r. au div absolute p.r. à la page

  9. CSS Pseudo-classes div:hover { background-color:#ffeeee } div:hover span { font-size: 120% } div.commerce:hover p { font-weight: bold; } ♪ <divclass="commerce"><span>AAAA</span><br><p>mmmmm</p></div> ♪ un p dans un div de classe commerce sur lequel la souris passe est mis en bold

  10. Apparition d’un élément ul ul {  background: #fed;  position: absolute;left: -3000px;}   ul li:hover ul {  left: 7em;top: 4px;} hover ul ul position:relative ul position:relative ul 4px ul ul 7em -3000px

  11. Tutorials CSS Tooltip series http://www.communitymx.com/content/article.cfm?cid=4E2C0 CSS Flyouts (menus) http://www.communitymx.com/content/article.cfm?cid=55A69 Tool tip

  12. Exercice • Créer une page contenant un menu dont chaque élément appelle une autre page • Les autres pages ont un lien qui revient sur la page ci-dessus

More Related