![]() |
'ID already defined' Problems
Does anyone know why I cant use something like:
Code:
<div id="headerfont">Hello blah</div> Quote:
Anyway round it? |
Have you checked in your CSS file that it hasn't been defined twice?
|
Yes. My CSS is completely valid.
|
IDs must be uniqe ... see W3C XHTML Documentation
Quote:
|
So what's a way round it? I need to use the ID twice.
|
You can't ;)
Why do you need this ID twice? For CSS? |
Well I want to use the ID which is used by CSS for font title - and since there are many of them I want to use it more than once (unless im missing something?)
|
Quote:
Can you post an example of the CSS you want to apply/use? |
Quote:
Code:
#headerfont { color: red; } |
@Chroder
I do know how to apply CSS to IDs - thanks ;) But I don't know what assassingod want's to achieve ... #id CSS is for central formatting a single element (you could also just do that using style=".."). If he want's CSS for many element's he would use a class. So I don't get why he needs multiple elements with the same ID, as this doesn't make sense to me? |
Chroder said it fine, except I want to be able to use
Code:
<div id="headerfont">esfdsfds</div> |
This is not possible without breaking XHTML 1.0 rules :)
And I still don't understand WHY you need multiple elements with the same ID ... Code:
<style type="text/css"> |
Because i'll be implenting it into a system. So the output of the script will be:
Code:
<div class="whatever"> |
Well, in the code you just posted you are using class, so where is your ID problem?
Where do you need multiple elements with the same ID, that's what I don't understand? |
Alright, let me try another way:)
|
Quote:
Quote:
[high]* Chroder takes a note[/high] |
Ok i've fixed it now - thanks:D
|
All times are GMT. The time now is 05:02 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|