Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

CSS Within PHP Echo

Featured Replies

Hi All,

 

Im trying to apply some CSS to an echo statement and it will not work. :(

 

The echo is still printing, its just not applying the CSS, i have used the CSS on another HTML page so i know the CSS is correct.

 

I'm not that good with PHP and because of this, its probably a simple mistake with a " or '

 

echo "<p class=\"whitetext\"><a href=\"menu.html\">View The Shoutbox</a></p>";

 

Thanks in advance

Your PHP is correct. Fancy posting the CSS?

 

EDIT: If you want a hyperlink to appear as 'whitetext', you need to make a new CSS rule like:

 

.whitetext a:link {

}

 

Assuming you haven't done that. That's the only thing I could see preventing it.

  • Author

Hi Shaun,

 

I have used the following CSS:

 

.whitetext { color: #FFFFFF; }

 

I have applied the CSS to an HTML link and it works fine, but when applied within PHP it won't :(

 

Thanks

It shouldn't work in HTML, though. You're not defining the link style.

 

See: http://www.ggth.net/testcss.php

 

You just need to do what I said before:

 

.whitetext a:link {
color: #FFFFFF; 
}

  • Author

Thanks,

 

I'll give that a go when i get home from work, Thanks once again :)

Thanks,

 

I'll give that a go when i get home from work, Thanks once again :)

if no jot try this

 

css

 

.whitetext a  {
font-size:72px;
color: #990000;
}
.whitetext a:hover  {
font-size:72px;
color: #66CC66;
}

 

with

 

<?php echo "<div class=\"whitetext\"><a href='menu.html'>View The Shoutbox</a></div>"; ?> 

  • Author

Hi pat24,

 

I have only just seen your post, but i tried Shaun's suggestion last night and it worked fine. :)

 

Thank you both for your input.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.