MikeBobiney.com Blogging for the fun, the fame and the fortune!

21Mar/080

CSS Management Techniques

Idealy, your stylesheets should be done with modularity in mind.  It is not uncommon to find a stylesheet file with hundreds if not thousands of lines of text which all contain the same 6-7 css attributes.  I have two solutions for this problem, one using ASP.NET 2.0 and one without.

My main.css Stylesheet (without ASP.NET)

@import url(initial.css);  /* Default your styles across multiple browsers */
@import url(pages/home.css);
@import url(pages/about.css);
@import url(pages/contact.css);
@import url(layout.css);
@import url(fonts.css);
@import url(hacks.css);

Using this method, you only need to include a reference to one stylesheet which imports the rest into your page.  This way if you decide later that you no longer need an about page for example you can remove that line of code which means your about.css file is no longer being downloaded when your page loads up.  Less files to download equals faster page loads.  Note how each stylesheet serves its own unique purpose.  Also note that the order of your css imports are important because of the fact that you can very well overwrite attributes that were defined previously which is why initial.css is first and hacks.css is at the end.

ASP.NET 2.0 Method

ASP.NET 2.0 has had a feature around since the 2005 version of Visual Studio which is called Themes.  Using themes you can style your entire website using Skin files.  These Skin files consist of a subset of asp.net markup that deals with style properties, stylesheets and images..  One advantage of this method is how with a single reference to your theme in the web.config file of your asp.net page you can import all stylesheet files contained within this folder.  Simply put, you can add add as many stylesheet files as you want in any type of folder structure under themes and asp.net will include them in all your pages.  Pretty niftey eh?

  • Share/Bookmark
Filed under: General No Comments
   

Greetings

Welcome to my own little piece of the Internet to write about all that interests me, technology related and other wise. Many of the topics on this blog are ones which I have come across on my everyday job as a Web Developer.

Twitter

LinkedIn

Mike Bobiney

Recent Posts

Archives

Meta

xeex430503 werewolf features tic tac wildberries agua caliente resort true flare shower door plexiglass plume de les fleming jorgensen stampaway convention and opera penn statutes auditorium rochester ny barton grosse ile mi sharon montague easter activities crafts eggs origami eton e10 charging problem anything to survive je ne te connais pas translation carpet caster bobbi hubner olga raz r d content area visualization jeep backround myspace quite aire blackberry aim system requirements tribal food safety statutes ordinances makita lxt door lock schematics 1996 lincoln frederick alison rowe wedding vision 1 boiler controler zone control capm apt formula jo bee bee pollen pills weather in outer banks nc flying fifteen melbourne wilts and berks canal lowest co2 emissions eastland ghost chicago river picture commercial buildings for rent lease chevy 305 stroker kit photo lebron dunk tim duncan privacy on your deck monroe county court records bridal shows dfw traumatic retinal detachment ted waterman oriental chicken salad receipts parachuting spiders kohler air cooled engine parts how do echinoderms obtain oxygen sentence and fragment worksheet luzon king charlemagne catfish klonk thomas more college edgewood wolfson 24-bit dac oc 1 outrigger prices alabama death record triple s rug cleaning norwalk ct reasons for being dizzy emachines p4 powersupply exercise induce asthma 2005 harley davison motor assemble dog collar black white polka dots anatomy coloring pages chippewa county michigan map is cdma digital or analog recette rapide pate austin washburn 2006 burton day hiker broken necks in football youtube vedeos riddles and there answer johnney and the sprites thank you led zepplin the timbers oakwood chico incidence of tbi among military lyrics to take this waltz ktm dirt bike mechanical manuel christian clowns grindhouse international harvester millenia salon spa in easton pa free fortune readings online notice of exclusion from pers membership free raggedy ann pattern sugars tea room clair engle lake said debates on homework critical thinking answer examples anders heller hilts auto san carlos ca anthracnose mondo grass symptoms dr fred lutz crawfordville 1960s chinese anthem the east medcalf frisco tx swell maps nikki sudden dies toshiba america tv parts bullard high photographer pros and cons of polygamy moorestown pa real estate graden chairs and tables hire bedfordshire rafael reyes arce mercadotecnia pol tica electric bagpipe writer darrell bacon chester pa redaccion del problema de investigacion amor automatico personnel management today claremont hospital cape town tool hangers and hardware car kleen car wash concentrate better business bureau gutter repair memphis sopranos story line microwave 6611 tamagotchi town street map santiago chile define bisque omd poly sinking boat photo deuce biglow apostolic council of prophetic elders rick steves canada fouquet jean nicolas 2001 oldsmobile intrigue sci-fi knights restoring prosperity sandlot investment katrina slidell la brain capability blackburn trackstand fluid littlest pet shop no 825 dh dpt jack mccall shoots wild bill hickok hairspray explosive detector lakenheath airforce base 47 news jacksonville fl great forest park balloon race 2007 nissan quest dvd remote national assocation of event planners strafford hotel dover nh birdman nick five factor diet recipes fsx demo klara feldman celtics green news braun bodycruzer shoppers drug mart yahoo account opened during year2007 secret war oakland play combined health information database capp city diner columbus ohio queen size iron headboards grosso concerto newman st andrews at westcliff daniel boone the cumberland gap sublime wallpaper fixer upper boats for sale reward and retention schemes in dominos swine reproduction avaya 7311 lcd display group iii synthetic oil dragon ball gt everything com grand orient fr rikki andersen speer reloading data 30-30 john savage oaklyn nj badminton magazine tamron spotting scope geocities and mohegan indians parkview highschool breckenridge christmas day businesses gateway at sienna plantation apartment homes randy orton current girlfriend recitation by ahmed al anzi jalapeno cheese popper recipe harlequin dwarf lop rabbits pvc commodities breeder composting recipe hoberman mini sphere orbiter harlem renaissance restaraunts timkin pinion gear bearings yves saint laurent contact 1940s dress patterns portage controls inc fabian nunez speaking against unions speedstream and linksys statistics anova new hampshire volkswagon dealers stonewall cable pizza hut italian bistro in missouri jealousy and abandonment shapes maths printers dana doudou ryan noble key largo condo ocean city md los caprichos by goya herb chambers dodge star wars ball hopper geauga county property search the big idea with donny deutsche compaq nx7010 errors in device manager saint etienne caen most complicated software pa rum pa pum song closure canada packers winnipeg electrical resistivity method for groundwater exploration 7 segment led display unit bed and breakfasts in norfolk virginia free knight avatars burris signature 2-8 specifications norma shearer ring added spaces nova scotia lucas county recreation center maumee jeep patriot saftey ratings livewell cooler north dakota department of transpotation kenwood 100watt uhf base station anne hathaway brokeback video tailor bunion removal of bursa sack giant ocr tektro truvativ 6061 rockcrete clare suzanne mcneil east coast distributers tate county tax accessor coin in beer can trick san jaun capistrano mission hard wax hair removal troubleshooting ground faults on fire alarms when hell freezes over similar sayings dedicated health services pvt limited india thomas benton reed book emanuel crunch time cheltenham pennsylvania real estate hot tapping machines barclay mastercard gem general music sapphire john dolan pittsburg finance outlander 800 rear suspension the beach reporter newspaper cv ambler theater pam armstrong greek symbols planets sea devils and accesseries actionfigures charm glow grill junior high youth group lessons betula birkenstock sandals solo handbell ringer sheet music taxonomy of pinto beans natural things to do for fibromyalgia noth face boots ibis bird guidelines for writing in apa style snoqualmie massage tom barrett impeachment clinton mla 600 coagulation dungeons and dragons rpg dice open an ayurvedic clinic rion exploited teens food processing metal detectors cintex african folk trilogy credit cards salute visa card ozzy mama i comming home brian mcbride to chicago fire slugger sb105 forest lawn fond remembrance crypt 6417 raymond croze introduction for latest work in metrology float fade firefox disposable helium gas cylinders cra policy rhein main bombing mayberry deputy badge crain h d air lifter san antonio convention center nole fan fsu marketing manager mayfield dairy rapidshare duran duran come undone review of the personality assessment inventory joao leandro bueno los flames free advise on picking nfl games the pig pen 650 california kaiser insurance providers ppo magnum 44 claber groupe lisi chinese ting gazebo view cart candle fragrance oil cranberry juice toothache skidoo formula mx snomobile skis covered motercycle requirements att page pac plus plymouth and brockton railway extreme cellists river city rascals baseball bridgestone firehawk tires loren morris robert montraville blythe top 10 accountancy firms in ireland patient centered technologies swarovski or austrian crystal broach tracing papers beanie sigel gets dropped gaming projectors hm courts suzanne somers protein bars robert m samuels golf contest glenview map sahara desert berber cascada what hurts he most rumble and frenzy earphones hoover wind tunnel bagless canister vacuum griffiti creators the star wars kid kills himself real men of genius bud light rs232 temperature caught my sister inserting a tampon galaxie lightweight un shin bup nicholas neptune babnana splits left 4 dead storyline four eared bunny ascot distributers santa barbara ca genetics of hardy perennial hibiscus seiko original watchband hugh hefner pajama pics sal amendola email physicians choice classic memphis wrestling spainish mane immaculate conception school in wellsvile ny retrain the off the track thoroughbred mary fischer bryant tx christine e wilkinson loc on titan neutrogena instant bronze scott allan wertenberger dairy farm methane capture methodology nee knapp picture of 12 zodiac signs baskin robbins calories maintaining stability and positive morale micro trak 3000 ag sprayer monitors chicago bulls intro towable backhoe plans rv pedestals pagoda kit microsoft virtual server login dr michael hahn complaints folding laundry sorter jeanne loveless preview love fool by just jack