CSS Style

AXISHK
AXISHK used Ask the Experts™
on
Any idea how to change the hyperlnk text to white color. "td" has set to white color but it can't be applied to the <a> element. Thx


<td style="background-color:navy;color:white;"></td><td style="background-color:navy;color:white;">
<?php
      if (session_status() == PHP_SESSION_NONE) {
                session_start();
      }
      echo "<span id=\"userinfo\"><a href=\"signin.php\">Login</a> &nbsp;&nbsp;&nbsp;<a href=\"validatesignup.php\">Signup</a></span></td>
C--temp-CSS.png
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
I Design & Develop Software
Commented:
if you want it in a css style

do
td >span#userinfo>a {
color:white;
}

Open in new window

or if you want it inline

<span id=\"userinfo\">
    <a href=\"signin.php\" style=\"color:white;\">Login</a> &nbsp;&nbsp;&nbsp;
    <a href=\"validatesignup.php\">Signup</a>
</span>

Open in new window

Author

Commented:
Thx, it works.

Is there a way to check the attribute support for HTML element which make the coding much more easier ?

Thx
PawełI Design & Develop Software

Commented:
do you mean specifically for styling? i generally use the dev tools in chrome, but it's really something that you have to just do a lot of to figure out
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Is there a way to check the attribute support for HTML element which make the coding much more easier?

When you say attribute support, are you referring to getting auto suggestion of attributes while coding?

Author

Commented:
Yes.
Othewise, any online website that allow inputing an element and display all related attrbutes for it.

Thx again.
Most Valuable Expert 2017
Distinguished Expert 2018
Commented:
echo "<span id=\"userinfo\"><a href=\"signin.php\">Login</a> &nbsp;&nbsp;&nbsp;<a href=\"validatesignup.php\">Signup</a></span></td>

Take some time to learn about PHP HEREDOC syntax. Using it the above debugging / readability nightmare looks like this
echo <<< HTML
  <span id="userinfo">
    <a href="signin.php">Login</a> &nbsp;&nbsp;&nbsp;<a href="validatesignup.php">Signup</a>
  </span>
</td>
HTML;

Open in new window


Othewise, any online website that allow inputing an element and display all related attrbutes for it.
I use MDN (Mozilla Development Network) and W3Schools

Between these two sites you will find - what attributes are available, what they do and what browsers they are supported on.

A note on styling <a> elements. You need to explicitly include the a in the style in other words if you have
<div class="white-text">
   <a href="#alinktosomewhereonthepage">This should be white</a>
</div>

Open in new window

And your css is
.white-text {
   color: white;
}

Open in new window

The <a> will not be white - you have to expressly state
.white-text a {
   color: white;
}

Open in new window


This sample illustrates the concept.

Another key thing to note is that the path to the element is important.
If you have
<div class="top">
  <div class="middle">
    <span class="target">
      Red text by css
    </span>
  </div>
</div>

Open in new window

And you have
.top .middle .target {
   color: red;
}

Open in new window

The text will be red.
If you then add after this
.target {
   color: blue;
}

Open in new window

This will not affect the style on the page - you have to override the full path.

The above sample illustrates

Author

Commented:
Thx

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial