Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CSS Stycling technique
#2
You typically never put styles inline aside form one offs.
Plus styles are a pain in the ass in most editors, they like to reformat stuff how they please.

It takes 5 seconds to add a class, in fact it should be second nature to add ids and classes to all elements you write , then you just style it later on all at once.

Or build up your own collection of styles you can use if you use them alot but do not want to really style your site.


.margin-none
.alert
.well


for example grid systems you can do quick stuff like.
.span4

learn specificity and you can do alot of stuff easier and smarter.
need to target a specific page and change a few things then override the defaults using specificity.

Code:
h2 { font-size:20px }
#pagename h2 {font-size:30px } /* this works because we put the page slug as id in the body tag */

Or alternative heading colors.
h2 {color:blue }
h2.alt1 { color:red } /* h2 with a class of alt1 */

use multiple classes

<h2 class="title bold italic">heading 2</h2>
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply


Messages In This Thread
CSS Stycling technique - by bhwebco - 2012-12-14, 05:35:13
RE: CSS Stycling technique - by shawn_a - 2012-12-14, 05:43:27
RE: CSS Stycling technique - by Timbow - 2012-12-14, 22:14:14
RE: CSS Stycling technique - by bhwebco - 2012-12-14, 06:23:10
RE: CSS Stycling technique - by bhwebco - 2012-12-15, 03:23:51



Users browsing this thread: 1 Guest(s)