Webmaster Sitesi
Geri git   Webmaster Sitesi > Değişik Dillerde Webmaster Sitesi Forumları > English Webmaster Forum

Your First Style Sheet Using Cascading Style Sheets or CSS

English Webmaster Forum forum başlığına Your First Style Sheet Using Cascading Style Sheets or CSS konusunun bir özeti As HTML becomes more and more a description of the content of Web pages and less the look and feel, you need a tool to describe how your pages should ...
Cevapla
 
  #1  
WS 24-12-2009, 07:58
Engineer Resmi
Mühendis
4. Rank
 
Blog Yazıları: 4
Standart Your First Style Sheet Using Cascading Style Sheets or CSS

As HTML becomes more and more a description of the content of Web pages and less the look and feel, you need a tool to describe how your pages should look. That's where Cascading Style Sheets (CSS) come in.

CSS is not hard, in some ways it's almost easier than HTML. The trickiest part is remembering the many different choices you have to choose from. Let's start with a simple style sheet that includes some of the more common styles.

Fonts and CSS
The most common adjustment to Web pages is to the fonts on the page. You can change the color, style, size, and face of your fonts, and you can do it all with CSS.

Creating a Style SheetThe first key to writing a style sheet is to decide what you want your text to look like. You should decide the color, the font, the style and so on. You also need to decide what the different styles should be for the different tags, headings, and so on.

My Proposed Styles•Standard paragraph text should be black, arial narrow, and medium sized
•Top level (h1) headings should be red, bold, and small-caps
•Second level headings (h2) should be blue and italic
•Notations should be standard text with a yellow background
These are the CSS elements that can change the font. Examples for how to use the CSS property are included in italics:

•font-family
change the actual face of the font. You can use specific font names or generic terms such as serif, sans-serif, monospace, courier, fantasy
font-family : arial, geneva, helvetica;
•font-size
change the size of the font. Define the size as an absolute size, relative size, percentage, or length.
font-size : small
•font-style
changes the style from normal to italics or oblique.
font-style : italic
•font-variant
change the look of the text from normal to small-caps
font-variant : small-caps
•font-weight
change the font to bold
font-weight : bold
•color
change the color of your text. Use either named colors or hexadecimal codes
color : #ff0000
•background-color
change the color behind the text. Use either named colors or hexadecimal codes.
background-color : yellow;
Once you've decided on the styles you want, you need to write your style sheet. Place the following in the <head> of your HTML document:

<style type="text/css">
<!--
p { color : #000000; font-family : arial narrow; font-size : medium; }
h1 { color : #ff0000; font-weight : bold; font-variant : small-caps; }
h2 { color : #0000ff; font-style : italics; }
.note { background-color : #ffff00; }
-->
</style>
The first three of the above styles will be set by using the tags: <p></p>, <h1></h1>, and <h2><h2>. The final style notation is used with the class attribute. Since it is a notation that would be on text within a paragraph, but not a separate paragraph, it would usually be used with the <span></span> tag. Paste the following HTML into the document with the above CSS:

<p>
This paragraph would be in the p style. <span class="note">Note: inheritance means that this text will have the same styles as the paragraph itself</span>
</p>
The styles set by the first tag will be inherited by any tag that is within it. This is why we don't have to redefine the font color or size for the note
WS
Cevapla


Konuyu Toplam 1 Üye okuyor. (0 Kayıtlı üye ve 1 Misafir)
 
Seçenekler


Benzer Konuları Oku
Konu Konu Açan Forum Cevap Son Mesaj
css listeleme özellikleri hakkında yardım ekselans0042 Soru - Cevap 3 17-02-2010 15:40
crwZ - bLacKsTar styLe Crowzer vBulletin 1 12-02-2010 15:04

Bağlantı Kur, Contact, Forum Kullanım Sözleşmesi, Gizlilik ~ siteler hakkında Style By: Powered

Saat: 07:45

 
© Copyright. All Rights Reserved. Webmaster Sitesi, Dünya'nın çeşitli yerlerinden katılan kullanıcılardan oluşmaktadır. Yönetim olarak her konuyu incelesek de bazen gözümüzden kaçabilmektedir. Açılan konularda bir yanlışlık veya yasalara aykırı içerikler görürseniz bu Webmaster Sitesi'nin sorumluluğunda değildir. Bizzat paylaşımı yapan kişi veya kişilerin sorumluluğundadır. Böyle bir durumda Webmaster Sitesi sorumlu tutulamaz, yargılanamaz.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249