Old 21-02-2008, 17:16   #1 (permalink)
mgpwr
with a hint of lemon
 
mgpwr's Avatar
 
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
  Reply With Quote
Old 21-02-2008, 17:24   #2 (permalink)
herkalees
Semantics, yay.
 
herkalees's Avatar
 
Join Date: Nov 2005
Location: Salem, Massachusetts
Posts: 1,104
You do have a php parser on your hosting account, and the file name ends in .php, right?
__________________
  Reply With Quote
Old 21-02-2008, 17:36   #3 (permalink)
mgpwr
with a hint of lemon
 
mgpwr's Avatar
 
Join Date: Aug 2006
Location: Hull
Posts: 484
yeah and yeah
__________________
Online portfolio: mgpwr.co.uk
  Reply With Quote
Old 21-02-2008, 17:51   #4 (permalink)
pgo
i'm done, son
 
Join Date: Jan 2005
Posts: 12,262
What does it return? Nothing?

Try changing it to something that's not a function. Say, <?php echo "Pooh."; ?>
  Reply With Quote
Old 21-02-2008, 17:54   #5 (permalink)
roo
Scatterbrained.
 
roo's Avatar
 
Join Date: Oct 2007
Location: South Wales, UK
Posts: 224
I'm quite new to CSS... and this is unrelated, but why do you have a class and an id assigned to one element? Why not style it completely using #date { } ?
  Reply With Quote
Old 21-02-2008, 18:00   #6 (permalink)
pgo
i'm done, son
 
Join Date: Jan 2005
Posts: 12,262
Quote:
Originally Posted by roo
I'm quite new to CSS... and this is unrelated, but why do you have a class and an id assigned to one element? Why not style it completely using #date { } ?
I'd be more concerned with the "style15" thing. That looks like classically bad Dreamweaver code.
  Reply With Quote
Old 21-02-2008, 18:08   #7 (permalink)
Paul
Junkie[scum]
 
Paul's Avatar
 
Join Date: Oct 2006
Location: location, location
Posts: 1,736
Quote:
Originally Posted by pgo
I'd be more concerned with the "style15" thing. That looks like classically bad Dreamweaver code.
yup
  Reply With Quote
Old 21-02-2008, 18:16   #8 (permalink)
pgo
i'm done, son
 
Join Date: Jan 2005
Posts: 12,262
Cue "Jaws" music.
  Reply With Quote
Old 21-02-2008, 18:31   #9 (permalink)
haku
shiro
 
haku's Avatar
 
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.
  Reply With Quote
Old 21-02-2008, 18:40   #10 (permalink)
roo
Scatterbrained.
 
roo's Avatar
 
Join Date: Oct 2007
Location: South Wales, UK
Posts: 224
Got you, cheers haku
  Reply With Quote
Old 21-02-2008, 20:39   #11 (permalink)
haku
shiro
 
haku's Avatar
 
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.
  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