Jump to content

wont make it turn red wtf?


Monkuar

Recommended Posts

EDIT: Why move to css help this is php help.. it's something to do with $subject variable.. i posted the code for u.. :D

 

Because it's a CSS issue, not a PHP issue. Just because you used PHP to output it doesn't mean it's where the problem is.

 

Ok i'll try that right now..

 

You missed this part:

[...] and then style it and the links within it.

Link to comment
Share on other sites

  • Replies 51
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

You missed this part:

[...] and then style it and the links within it.

Maybe because i dont understand that?

 

what does links within it mean? add a ahref in therE?

 

and it could be a php problem because $subject could have a function called before it that replaces any txt lol like strpos or w/e

Link to comment
Share on other sites

WHOOPS! Do this:

 

<script type="text/css">
a.red:link
{
color:#ff0000;
}
</script>

<?php
//All your PHP stuff...

//Some more PHP stuff...

echo '<a href="#" class="red">' . $subject . '</a>';

//Even more PHP stuff...

Link to comment
Share on other sites

WAIT WAIT!

 

ok i did what daniel said and he said to put a ahref so i did

 

else if ($cur_topic['icon_topic'] == '2')
        {
            
            $subject = "<span class=\"lol123\"><a href='index.php'>hey</a> $subject</span>";
        }

 

and "Hey" shows up normal text like $subject.. omg

 

so there's a hiding .css in my files somewhere that is changing ahref link color? OMGgggggggggggggg

Link to comment
Share on other sites

so there's a hiding .css in my files somewhere that is changing ahref link color? OMGgggggggggggggg

 

Uh... yeah. It's built into every browser. Otherwise text that isn't explicitly styled by the web developer would be displayed all next to each other.

 

I think what you should do is to learn about CSS.

 

Amtran, class="red" is pointless. Classes should convey semantics, not presentation. What if you decide that all the links that have class="red" should later be blue?

Link to comment
Share on other sites

so there's a hiding .css in my files somewhere that is changing ahref link color? OMGgggggggggggggg

 

Uh... yeah. It's built into every browser. Otherwise text that isn't explicitly styled by the web developer would be displayed all next to each other.

 

I think what you should do is to learn about CSS.

 

no i mean is there a .css in my files that is

 

a.red:link
{
color:#ff0000;
}

but says purple?

 

bcz if so i need to find and delete it quick cause i cant have it u know..

Link to comment
Share on other sites

Amtran, class="red" is pointless. Classes should convey semantics, not presentation. What if you decide that all the links that have class="red" should later be blue?

 

Oh alright :P

 

So class="supercoolawesomelink" is better? ;)

Link to comment
Share on other sites

so there's a hiding .css in my files somewhere that is changing ahref link color? OMGgggggggggggggg

 

Uh... yeah. It's built into every browser. Otherwise text that isn't explicitly styled by the web developer would be displayed all next to each other.

 

I think what you should do is to learn about CSS.

 

no i mean is there a .css in my files that is

 

a.red:link
{
color:#ff0000;
}

but says purple?

 

bcz if so i need to find and delete it quick cause i cant have it u know..

 

No, he means every browser will automatically set the text color and attributes if not specified by the website developer.

Link to comment
Share on other sites

Amtran, class="red" is pointless. Classes should convey semantics, not presentation. What if you decide that all the links that have class="red" should later be blue?

 

Oh alright :P

 

So class="supercoolawesomelink" is better? ;)

 

Yeah, or "closed", or "important" or whatever.

Link to comment
Share on other sites

Yeah, there is a reason. As I said, you should learn CSS.

 

You need to apply rules to a selector called .se a otherwise the a will take precedence.

 

no..

 

that's bologny.. bcz on my site, 24-7gt.com.. on the forums i use <font color=red> and it works just fine i using same .css this is horseshit.

 

something is wrong.. and ur telling me i need to learn css? pft... lol

so it has nothing to do with freaking css

Bro. i even removed MY WHOLE DAMN CSS And it didn't work..

 

Link to comment
Share on other sites

Plain

<font color="red">foo <a href="#">bar</a></font>

will never result in a red link.

 

Things aren't horseshit because you don't know how to use them. On the contrary, one could attach certain adjectives to you because you are using the things incorrectly, but I shall refrain from doing so.

Link to comment
Share on other sites

Plain

<font color="red">foo <a href="#">bar</a></font>

will never result in a red link.

 

Things aren't horseshit because you don't know how to use them. On the contrary, one could attach certain adjectives to you because you are using the things incorrectly, but I shall refrain from doing so.

dggfnq.jpg

 

Ok i see u daniel..

 

 if(strpos($topic['style'],'a') !== false)
$topic['title_styled'] = "<font color=blue>{$topic[title_styled]}</font>";

 

why does that work on my 24-7gt.com then??

 

zz...

Link to comment
Share on other sites

Right, that's what I'm telling you. It will not result in a red link. You have to style the link yourself, hence the reason why you should learn CSS.

 

I don't build bridges without knowing physics either.

 

30m05eg.jpg

 

SEE? Look it's red.. rofl and im using this for that code:

  if(strpos($topic['style'],'c') !== false)
                   $topic['title_styled'] = "<span style='color:red;'>{$topic[title_styled]}</span>";

 

see i told u im right

 

save that screenshot to your desktop too :P

so it's obliviously not a css issue.....

Link to comment
Share on other sites

Seriously... :facepalm:

 

Can you tell me the difference between these two things?

 

<span style="color:red"><a href="#">foo</a></span>

<a href="#"><span style="color:red">foo</span></a>

 

Maybe you should stop acting smug when you don't know what you're doing.

Link to comment
Share on other sites

Seriously... :facepalm:

 

Can you tell me the difference between these two things?

 

<span style="color:red"><a href="#">foo</a></span>

<a href="#"><span style="color:red">foo</span></a>

 

Maybe you should stop acting smug when you don't know what you're doing.

 

that makes no since because that s/s im showing u is a link..

http://forums.24-7gt.com/index.php?showforum=81

go and click it...

 

 

and yes the 2 difference is the text after link

 

Link to comment
Share on other sites

It makes perfect sense.

 

In the latter you are making the red text a link. In the former you are trying to make the link red, but seeing as the link already has its own style it's not affected by the rule you're trying to apply.

 

If you cannot (or will not) understand it, then there is nothing I can do about it. You can show me all the screenshots in the world, but that doesn't mean you are right. You cannot say X is Y, therefore Z is Y when X and Z aren't the same things.

Link to comment
Share on other sites

It makes perfect sense.

 

In the latter you are making the red text a link. In the former you are trying to make the link red, but seeing as the link already has its own style it's not affected by the rule you're trying to apply.

 

If you cannot (or will not) understand it, then there is nothing I can do about it. You can show me all the screenshots in the world, but that doesn't mean you are right. You cannot say X is Y, therefore Z is Y when X and Z aren't the same things.

 

Ok then tell me how to add a red link to my css class, since u deleted my topic just cause ur mad?

Link to comment
Share on other sites

Knock off your personal attacks. Both in PMs and here. You've been told the solution numerous times. I refuse to help you anymore.

 

personal attacks?

 

im just talking to you..

 

 

 

Anyway sorry..

 

but applied the class="lol123" to my index.php with a href and it worked, but when i apply it here:

 

  $subject = "<span class=\"lol123\">$subject</span>";

 

it's still not working any idea? thank

Link to comment
Share on other sites

it's still not working any idea? thank

Wow,

Maybe you should read back as Daniel has given you solution already.. and example of why what your trying wont work and how to set it up to work..

 

I think you should create a blank html file and try a few static tests, just so the basics are clear in your head..

 

Then try the following

Can you tell me the difference between these two things?

 

<span style="color:red"><a href="#">foo</a></span>

<a href="#"><span style="color:red">foo</span></a>

 

Then LOOK at what your current output and you should see the solution!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.