Old 13-04-2008, 01:41   #1 (permalink)
campbell
Web Hoster
 
Join Date: Jan 2008
Posts: 113
connect html-css

I was wondering, how do you connect specific elements on a page to a specified css file. basically, the way to connect the html file to the css file without using the header.

trying to connect this to a specified css file
Quote:
<div>
<b class="spiffy">
<b class="spiffy1"><b></b></b>
<b class="spiffy2"><b></b></b>
<b class="spiffy3"></b>
<b class="spiffy4"></b>
<b class="spiffy5"></b></b>
<div class="spiffyfg">


<!-- content goes here -->


</div>

<b class="spiffy">
<b class="spiffy5"></b>
<b class="spiffy4"></b>
<b class="spiffy3"></b>
<b class="spiffy2"><b></b></b>
<b class="spiffy1"><b></b></b></b>
</div>
  Reply With Quote
Old 13-04-2008, 03:02   #2 (permalink)
Bill Posters
trouble free and loverlee
 
Join Date: Mar 2003
Location: YooKay
Posts: 2,875
Why "without using the header"?

You just link or @import the stylesheet to the document which contains that markup and the browser does the rest.

If, for some reason, you can't use the header (by which I assume you meant the head section of the document markup), then you're only course of action is to use inline styles (see above link).
(Well, actually, that's not entirely accurate. You can link or @import a stylesheet from within the body, and so long as it comes before the markup to which it refers, you should get no rendering issues. However, that's a less than optimal approach as many consider that calls to external stylesheets should be contained exclusively within the head section.)


Incidentally, that's some really horrible code.
Why all the b elements? Why the inappropriate nesting?

Show us the page design and how you intend to use that code (I'm guessing header and footer graphics or 'rounded' corners), and I'm sure someone here can suggest a more semantically appropriate use of code to achieve the same outcome.
  Reply With Quote
Old 13-04-2008, 11:39   #3 (permalink)
campbell
Web Hoster
 
Join Date: Jan 2008
Posts: 113
I know there is away to connect specific elements to a specified style sheet because I've seen it before but I can't find it and that is why I can't take the code from it.

Also, I got the code from this.
Spiffy Corners - Purely CSS Rounded Corners
  Reply With Quote
Old 13-04-2008, 13:10   #4 (permalink)
Heka1
Senior Member
 
Join Date: Jul 2007
Posts: 179
Having a site build your rounded corners is not good way to create them. I would suggest to look at tutorials and even the spiffy site and find out how to produce rounded corners your self. If you learn how to code the rounded corners your self then the code will most likely be easier to understand and fit better into your page.
__________________
XHTML, CSS, PHP, Flash Web Designer
www.Heka1.com
www.DrunkMobile.com/m
  Reply With Quote
Old 13-04-2008, 13:31   #5 (permalink)
pgo
i'm done, son
 
Join Date: Jan 2005
Posts: 12,262
You can't connect elements to stylesheets...that isn't possible. Stylesheets are connected to documents (or embedded in them) and they control the display of elements by selectors.
  Reply With Quote
Old 13-04-2008, 13:37   #6 (permalink)
campbell
Web Hoster
 
Join Date: Jan 2008
Posts: 113
Howcome some servers may have like many stylesheets being in use for one page then? How do they do that?

I have the web developer toolbar for firefox and some sites, it shows many different stylesheets. Like even this exact page for example has like 4.
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8