首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >伪选择n-子问题

伪选择n-子问题
EN

Stack Overflow用户
提问于 2014-10-20 13:04:11
回答 1查看 35关注 0票数 1

我只想选择第一个图像来向上移动:

代码语言:javascript
复制
#rockfon_mono:nth-child(1) img {
	margin-top:-40px;
  border: solid green;
	
}
代码语言:javascript
复制
<div id="rockfon_mono">
<img src="images/products/rockfon-mono/rockfon-header.png" alt="" />
 <h2>Mono® Acoustic TE</h2>

<p>Seamless acoustic ceiling and wall lining |  Acoustic and aesthetic comfort | No more compromises</p>
<p>The current trend in architectural design favours the use of highly reflective, sturdy materials such</p>
<div id="rockfonImageOne"> 
    <img src="images/products/rockfon-mono/Mono.png" alt="" />
</div>
 <h2>Acoustics</h2>

<p>Full acoustic control for any space | Acoustic enhancement for new and refurbished spaces | High sound absorption | Improved speech intelligibility</p>
<p>Acoustic and aesthetic comfort Mono Acoustic TE’s aesthetic quality matches its acoustic quality. Mono Acoustic TE provides high sound absorption, echo reduction, a significant decrease in reverberation</p>
<div id="rockfonImageOne"> 
    <img src="images/products/rockfon-mono/Acoustics.png" alt="" />
</div>
 <h2>Characteristics</h2>

<p>System description and performance the unique Mono Acoustic TE system is a highly acoustic monolithic ceiling and wall lining. This patented innovation is made of high quality stone wool for optimum</p>

然而,它正在选择整个页面中的每一幅图像。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-10-20 13:08:50

在特定的HTML中,您可以使用直接子标记,因为其他imgs不是直接子程序。

代码语言:javascript
复制
#rockfon_mono > img {
    margin-top:-40px;
    border: solid green;
}

演示

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26466393

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档