YesNoOk
avatar

HTML/CSS (Read 3711 times)

Started by Jh0nnY2k, April 06, 2016, 01:14:59 pm
Share this topic:
HTML/CSS
New #1  April 06, 2016, 01:14:59 pm
  • ***
So i got this on HTML part :

<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <link rel="stylesheet" type="text/css" href="main.css" />
    </head>
    <body>
        <p id="paragraf" name="paragraf">Ana are mere!</p>
    </body>
</html>


And this part on CSS Part

.paragraf:hover{
    color: brown;
    pointer-events: visibleStroke;
}

What am i doing wrong?

if i put :

p:hover{
    color: brown;
    pointer-events: visibleStroke;
}

It works. If i use the id "paragraf" it won't turn the text brown. Help?
Last Edit: May 12, 2016, 01:39:13 pm by Jh0nnY2k
Re: HTML/CSS
#2  April 06, 2016, 03:45:14 pm
  • **
  • M.U.G.E.N. Developer
  • Hello Baby :$
    • Venezuela
    • sasuke19161@hotmail.com
    • Skype - BlackFired
    • https://www.juanteran.com.ve/
Id for use in the css should be:

#paragraf

And for classes is as follows:

.paragraf



That was the problem in the css you gave style to a class when you have a id.



Code:
#paragraf:hover{
    color: brown;
    pointer-events: visibleStroke;
}
Re: HTML/CSS
#3  April 06, 2016, 09:07:33 pm
  • ****
  • Target Acquired.
    • Ukraine
    • mugencoder.com
Since it wasn't mentioned, I'll add in:

Code:
p:hover

works for you because it's selecting every "p" tag on the page, which obviously includes your #paragraf element.

-[Все слова это только слова.]-