| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
with a hint of lemon
Join Date: Aug 2006
Location: Hull
Posts: 484
|
WTF,, why???
hey when i type: <div class="style15" id="date"> Tuesday 10th April </div> the div will display, however when i add the following php to the div it does not display. <div class="style15" id="date"> <?php echo date('l jS F Y'); ?> </div> ?????????????????????????????????????????????????? ???? Online portfolio: mgpwr.co.uk
|
|
|
|
|
|
#3 (permalink) |
|
with a hint of lemon
Join Date: Aug 2006
Location: Hull
Posts: 484
|
yeah and yeah Online portfolio: mgpwr.co.uk
|
|
|
|
#6 (permalink) | |
|
i'm done, son
Join Date: Jan 2005
Posts: 12,262
|
Quote:
|
|
|
|
|
#9 (permalink) |
|
shiro
Join Date: Aug 2007
Location: Yokohama, Japan
Posts: 2,192
|
There can be reasons to have an ID and a class together for one element. The class can be used to apply styles that are consistent across all elements that have that class name. Using this allows you to change something across all elements with that class - for example you could be adding an underline to all links. But then the ID allows you to adjust the styling of that element specifically. Maybe you want that one link to be bold, but not the rest of the links that have that class. |
|
|
|
#11 (permalink) |
|
shiro
Join Date: Aug 2007
Location: Yokohama, Japan
Posts: 2,192
|
No worries. As a bit of a side point, an ID name may also be added for javascript reasons - elements with IDs are easy to target with external javascript. So an ID could be added for reasons that have nothing to do with styling the element. |
|
![]() |