开发者

Design all 'pre' tags inside a div in css

开发者 https://www.devze.com 2023-02-20 11:04 出处:网络
How do i style the width of all \"pre\" tags inside a div with some id ? I can\'t put the \"class\" attribute inside the 开发者_开发百科pre tag, becouse the pre tag is written by a function that i hav

How do i style the width of all "pre" tags inside a div with some id ? I can't put the "class" attribute inside the 开发者_开发百科pre tag, becouse the pre tag is written by a function that i have no access to it.


CSS

#parent {} /* add style to the parent element */
#parent pre {color: red} /* to the pre */

HTML

<div id="parent">
  <pre>aaa</pre>
</div>


like this???

div#id pre { styles here }


Use this selector div#someId pre...............

div#someId pre
{
    width: ...
}
0

精彩评论

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