开发者

Styling within div classes

I was wondering how I would style the p class="visit" on the code below because it won't allow me to just use

p.class { color: white }

<div class="OW_Container">
                    <div开发者_如何学Python class="text_wrap">
                    <h1>Finding Nemo</h1>
                    <p class="info">Lorem ipsum dolor sit amet, consectetur adipiscing elit. . </p>
                    <p class="visit"><a href="#">Visit the website here</a></p>
                    </div>
                    <img src="Images/Slide4.png"/>
                </div><!--end OW-->

I presume its because it's enclosed in the div class'

Thanks in advance!


You don't use "class" in the css.

p.visit { color: white }

Also, you generally need to target A tags more specifically:

p.visit a { color: white }


p.class { color: white }

will color all text white in p tags with a class called class like:

<p class="class">white text</p>

Try something like:

p.visit { color: white }


.text_wrap p{color:#fff}


What you are looking for is the cascading bit of CSS. Try:

div.class p.visit { color: white; }

That will style all p elements with class="visit" white but only inside of div.class.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜