House of Fusion
Home of the ColdFusion Community
Hostmysite Dedicated Hosting

Search css

August 30, 2008

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
           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             

Subscribe Now
Fusion Authority Quarterly Update - ColdFusion 8 Special Edition

For ColdFusion hosting try HostMySite.com.
Search over 2,500 ColdFusion resources here  >>>      
Home /  Groups /  Cascading Style Sheets (CSS)

Pro-bono advice anybody?

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group  
> Are there any better ideas, that maybe
Peter Boughton
05/09/08 02:08 P
Peter Boughton wrote:
Ian Skinner
05/09/08 02:36 P
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Ian Skinner
05/09/2008 12:45 PM

How would those of you who grok CSS composite this together? Goal is to create a Header|Masthead|Banner type structure across the top of the site's pages. I am trying to put together the following elements: A title: 'Sierra Outdoor Recreation' A logo: http://www.sierraoutdoorrecreation.com/images/sorlogo.gif -- generally visually replaces the title A logo background: http://www.sierraoutdoorrecreation.com/images/masthead/logo_spring.jpg | logo_summer.jpg | ect. A banner/background filler: http://www.sierraoutdoorrecreation.com/images/masthead/banner_spring.jpg | banner_summer.jpg | ect. A flash based advertisement for the printed SOR book. My first idea is something along the following.  I would normally have a linked CSS file, I am using in-line code here for brevity. <div id="masthead" style="background: url(banner_spring.jpg)">   <object id="flashAd" style="float: right;"....></object>   <div id="logo" style="background: url(logo_spring.jpg); height: xx; width: yy;">     <h1 id="title" style="background: url(sorlogo.gif); text-indent: -1000px; overflow: hidden;>Sierra Outdoor Recreation.com</h1>   </div> </div> Is this a good way to do this?  Are there any better ideas, that maybe reduce some of the layers?  Something that provides more cross-browser, alternate viewers, etc.compatibility?

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Peter Boughton
05/09/2008 02:08 PM

> Are there any better ideas, that maybe > reduce some of the layers? Definitely. Two key things: 1) Images have alt attributes, so the text-indent stuff is unnecessary. 2) Transparent images can have independent background images. Here's some nice compact HTML: <div class="banner">     <h1><img src="/images/sorlogo.gif" alt="Sierra Outdoor Recreation.com"/></h1>     <object class="flashAd" ... ></object> </div> And alongside the relevant styles... <!DOCTYPE html> <head>   <title>Sierra Outdoor Recreation</title>   <style type="text/css">     html,body     {margin: 0; width: 100%;}     .banner     {       width: 100%;       height: 98px;     }     .banner h1     {       background:url(/images/masthead/banner_spring.jpg) no-repeat top right;       margin: 0;       width: 890px;     }     .banner h1 img     {       background:url(/images/masthead/logo_spring.jpg) no-repeat top right;     }     .banner .flashAd     {       float: right; clear: right;     }   </style> </head> <body>   <div class="banner">     <h1><img src="/images/sorlogo.gif" alt="Sierra Outdoor Recreation.com"/></h1>     <object class="flashAd" ... ></object>   </div> </body> </html>

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Ian Skinner
05/09/2008 02:36 PM

Peter Boughton wrote: > Definitely. Two key things: > > 1) Images have alt attributes, so the text-indent stuff is unnecessary. > > 2) Transparent images can have independent background images. Thanks, but that is basically the current implementation I am trying improve on.  The part I don't like is that when CSS is not in effect the logo is rather ugly without its background component.  My goal was to replace it with a simple text title rather then leaving the incomplete logo in this case. My posted solution does this fairly well, I was just asking if there were any cool tricks or concepts I was overlooking.  At the moment I am pondering the issue of this offset solution not showing anything if CSS is on, but images is disabled.  That is probably not an important use case to spend a lot of effort on, but if anybody has an idea I would love to hear it.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Peter Boughton
05/09/2008 02:47 PM

> the logo is rather ugly without its background component. If the logo relies on the background to be complete, then it is a single image and thus should be a single file, not two. If the background will change throughout the year, you simply use layers in the original graphic file to handle this.


<< Previous Thread Today's Threads  

Mailing Lists