Sources and Related Posts
Kaynak: Smashingmagazine
Workflow: Get Inspired
[20 pro tips]
Kaynak: Smashingmagazine
Technical Tips: IE Tweaks
- You can force IE to apply transparence to PNGs. “In theory, PNG files do support varied levels of transparency; however, an Internet Explorer 6 bug prevents this from working cross-browser.” [CSS Tips, Outer-Court.com]
Technical Tips: CSS-Techniques
- You can specify body tag ID. “In most cases placing an ID in the body tag will allow you manipulate CSS presentational items and markup elements by page by page basis. Not only will you be able to organize your sections you will be able to create multiple CSS presentations without changing your markup from template to template or page to page.” [Ryan Parr, Invasion of Body Switchers]
Technical Tips: Styling Links
- Be careful when styling links if you’re using anchors. “If you use a classic anchor in your code (
<a name="anchor">) you’ll notice it picks up:hoverand:activepseudo-classes. To avoid this, you’ll need to either useidfor anchors instead, or style with a slightly more arcane syntax::link:hover, :link:active” [Dave Shea] - Define relationships for links. “The rel attribute is supposed to indicate a semantic link relationship from one resource to another.
Roger Johansson has written an extremely useful series of articles about CSS 2.1 Selectors. These articles are highly recommended to read - some useful aspects can be found in the list below. Note that selectors ‘>’ and ‘+’ aren’t supported in IE6 and earlier versions of Internet Explorer (updated). Devamını Okuyun »
Workflow: Debugging
- Add borders to identify containers. “Use plenty of test styles like extra borders or background colors when building your documents or debugging layout issues.
div { border:1px red dashed; }works like a charm. There are also bookmarklets that apply borders and do other things for you.” You can also use* { border: 1px solid #ff0000; }. [Chric Casciano]. Adding a border to specific elements can help identify overlap and extra white space that might not otherwise be obvious. [CSS Crib Sheet]
* { border: 1px solid #f00; }
- Check for closed elements first when debugging. “If you ever get frustrated because it seemed like you changed one minor thing, only to have your beautiful holy-grail layout break, it might be because of an unclosed element. [10 CSS Tips]
Kaynak: Smashingmagazine
Workflow: Setting Up Typography
- To work with EMs like with pxs, set font-size on the body-tag with 62.5%. Default-value of the
font-sizeis 16px; applying the rule, you’ll get one Em standing for roughly ten pixels (16 x 62.5% = 10). “I tend to put a font-size on the body tag with value: 62.5%. This allows you to use EMs to specify sizes while thinking in PX terms, e.g. 1.3em is approximately 1.3px. ” [Jonathan Snook]
Workflow: Use shorthand notation
- Shorten hexadecimal colour notation. “In CSS, when you use hexadecimal colour notation and a colour is made up of three pairs of hexadecimal digits, you can write it in a more efficient way by omitting every second digit:
#000 is the same as #000000, #369 is the same as #336699[Roger Johansson]
- Keep containers to a minimum. “Save your document from structural bloat. New developers will use many div’s similar to table cells to achieve layout. Take advantage of the many structural elements to achieve layout. Do not add more div’s. Consider all options before adding additional wrappers (div’s) to achieve an effect when using a little nifty CSS can get you that same desired effect.” [Ryan Parr]
Organize your CSS-code
- Organize your CSS-styles, using master style sheets. “Organizing your CSS helps with future maintainability of the site. Start with a master style sheet. Within this style sheet import your
reset.css,global.css,flash.css(if needed) andstructure.cssand on occasion a typography style sheet. Here is an example of a “master” style sheet and how it is embedded in the document:”
Workflow: Getting Started
- After you have a design, start with a blank page of content. “Include your headers, your navigation, a sample of the content, and your footer. Then start adding your html markup. Then start adding your CSS. It works out much better.” [CSSing]
- Reset your CSS-styles first. “You can often eliminate the need to specify a value for a property by taking advantage of that property’s default value. Some people like doing a Global white space reset by zeroing both margin and padding for all elements at the top of their stylesheets. Eric Meyer’s Global Reset, Christian Montoya’s initial CSS file, Mike Rundle’s initial CSS file, Ping Mag’s initial CSS file. [Roger Johansson]
CSS’de Kısaltmalar
Tabloları daha anlaşılır yapmak için bir satırın background’un farklı diğer satırını farklı yaparız bunu için dinamik ilk çözümü(en azından benim gördüğüm) alispart da idi http://www.alistapart.com/articles/zebratables/
şimdi ise işi daha basit hale gitren bir makale gördüm bitesizestandarts.com. Makalenin aşağıda linki var.
http://bitesizestandards.com/bites/automatic-coloured-rows
İkisini karşılaştırırsak alispart’ın kodu her tabloya özel uygulanaiblir. Ancak bitesizestanmdar’ın kodu sayfadaki tüm tabloları bu şekle çeviriyor. Seçimi sayfanıza göre yapacaksınız artık.
Kaynak: Fatih Hayrioğlu
CSS’e geçişte en çok düşündüren konu niye CSS geçelim ve CSS’in avantajları nelerdir? CSS’in avantajı bize web sayfasındaki elemanlara daha fazla müdahele etme imkanı vermesidir. Burada bunun en güzel örneklerinden birini göreceğiz. Devamını Okuyun »
Favorilerimdeki CSS linkleri
- BrainJar.com
- Dijital Web
- Cascading Style Sheets CSS Tutorials - Javascript Styles Change Styles Hover Styles
- Cascading Style Sheets Forum
- Cre8asite forums. CSS, Style, and Positioning. [ Search Engine Optimization, Usability and Web Design. ]
- CSS Garden
- CSS Vault
- CSS-guide, Index pages Table of contents of the CSS-guide (the longer version)
- CssBeauty
- CSS An Interactive Tutorial for Beginners [Dave’s CSS Guide]
- learn web standards css guide - contents
- Web - Authoring - Style - Sheets- Cascading Style Sheets - WebReference.com
- Introduction to CSS beginner’s cascading stylesheets tutorial HTMLSource ]
- CSS Tutorial
- Assorted CSS samples on Phrogz.net
- [ws] Wellstyled.com
- Digital Web Magazine
- Picment.com » Journal
- style-sheets.com - CSS cascading style sheets Tutorial (background-position css property) - crossbrowser stylesheets, css editor, reference, articles, css positioning, generators, tools and more !
- Toggle (show/hide) elements in a Definition List
- Free CSS Resources, freeprogrammingresources.com
- HTML, XHTML & CSS
- k css stuff
- Listutorial Step by step CSS list tutorial
- Little Boxes
- Mandarin Design Frequently Asked Questions
- The CSS and XHTML Lab 456 Berea Street
- The W3C CSS Validation Service
- W3C - Baba
- Web Design, CSS İpuclari
- Yahoo! Groups
- /* Position Is Everything */ Modern browser bugs explained in detail!
- Web Design References: Cascading Style Sheets
- Real World Style
- CSS Drive- Categorized CSS gallery and examples
Kaynak: Fatih Hayrioğlu
Css de kodumuzu İE’den gizleme
CSS’e başlamak
Cascading Style Sheets (CSS) HTML ‘deki bazı problemleri halletmek için ama asıl neden olarak da; web sayfası içeriği ve web sayfası görünümünü birbirinden ayırmak için oluşturulan bir standarttır.
CSS 1996′da W3C tarafından duyuruldu. Son olarak CSS2.1 versiyonu işler durumdadır. CSS3.0′da çalışmaları devam etmektedir. CSS3.0 için ayrıntılı bilgiye http://www.w3c.org/Style/CSS/current-work adresinden ulaşabilirsiniz.
CSS kullanımının bir çok bakından avantajları bulunmaktadır. Belli başlı avantajlarını sıralarsak:
Görünüm Avantajları
CSS HTML’e göre bir çok stil özelliğine sahiptir. CSS’in sayfa içeriği öğelerinin sayfa görünümü öğelerinden ayrılması için geliştirildiğini düşünürsek avantajı baştan anlaşılmış olur.
<h1>CSS'e Giriş</h1>
HTML’de bu elementi(h1) kalın,altı çizili, ardalanı kırmızı olarak atama gibi çeşitli stiller verbiliriz ancak bunlar içinde ayrı HTML elementleri kullanmak zorundayız (örn:strong, gibi), ancak CSS de bunu tek bir elementle yapabiliriz ve ayrıca daha fazla stil özellikleride atayabiliriz.(örn: kenarlık, rollover vs stillerini ekleyebiliriz.)
- h1 {color: white; font: italic 11px Arial, serif; text-decoration: underline; background: yellow url(titlebg.gif) repeat-x; border: 1px solid red; margin-bottom: 0; padding: 5px;}
Kullanım Kolaylığı
HTML’de her elmente artı özellikler eklemek için başka bir element ve özellik eklmemiz gerekiyor ve bu işlemi geniş çaplı bir sitede yaptımızı düşünütseniz çok büyük zaman kaybı ve uğraş gerektiğini göreceksiniz.
<h1><font color="blue">Başlık</font></h1>
Bunun gibi onlarca veya yüzlerce başlığınız olduğunu düşünün, gerçekten çok zor. CSS’de aynı işlem için
- h1 {color: blue;}
hatta daha sonra bu elementin özelliklerinde değişiklik yapmamızda kolay olacaktır. Hatta bu işlemi sadece bu etiket için değil diğer etiketlerede uygulayabiliriz.
- h1, h2 {color: blue;}
Ayrıca tek bir CSS dosyası ile sitenin tamamının yönetmekte web kodlamacıları için çok büyük kolaylıktır. Sadece bir dosyada değişlik yaparak tüm sitemizi yönetebiliriz isterse yüzlerce sayfa olsun.
Tasarım Tutarlılığı
Tek CSS dosyası ile tüm sitenizi yönetebilirsiniz bu ayrıca sitenize tutarlılık kazandıracaktır. Tüm sayfalarınıza aynı stil elementlerini ve özelliklerini atayarak sayfa tutarlılığını sağlayabilirsiniz. Web sayfanızdaki ilk sayfadan son sayfaya kadar tutarlılığınızı koruyarak ziyaretçinize düzenli bir içerik sunmuş olacak ve sitenizin kendine has özelliklerini ziyaretçiye benimsetmiş olacaksınız. Sayfalar hızlı yüklenecek ve doğru olarak yüklenecektir, çünkü aynı elementleri diğer sayfalarda tekrar yüklemeyecek ve bu ziyaretçiye zaman kazandıracaktır. CSS+XHTML ile HTML göre %50′ye varan performans ve hız artışları olacaktır.
Gelecek Vaadediyor
HTML giderek işlevselliğini kaybedeceği ve XML ve dolayısı ile XHTML’in işlevselliğini artıracağı düşünülürse, CSS gibi tümleşik bir stadardın önemi daha çok anlaşılıyor.
XHTML ile daha temiz kodlar üretilecek, farklı platformlara(pda,cep telefonu vs.) uyum sayesinde bilgi dolaşımı kolaylaşacak, sayfalarımız arama motorları programları tarafından daha anlaşılır olacaktır. CSS, XHTML teknolojisi ile tümleşik olarak çalışarak bizlere gelecek vaadediyor.
İlgili Linkler:
Kaynak: Fatih Hayrioğlu
