我试图让我的图像坐在旁边<H3>
我浮动了<div>
我的图像所在的位置(稍后将对其应用一些 JavaScript),但对于我的生活,我无法让它在它旁边的 H3 旁边有大约 10 或 12 像素的空间。
如果我应用 130px 左右的边距,我可以做到这一点,但是有一些 H3 元素每次的长度都不相同。我想我可以得到<h3>
一个自动宽度,所以它会在文本停止时停止(就像我的<h5>
和<h4>
元素似乎正在做的那样。),但它似乎占据了整行。因此,如果我应用或更多,我的问题就会出现(如您所见),margin-right:130px
因为后续<h3>
元素将比“复杂性因素”更长。
我想知道我是否应该将我的<h3>
元素放在 div 内的那个部分并在那个 div 上设置尺寸?无论如何,这是我的 CSS (不可否认,我对定位有点不稳定)
这是有问题的页面:
http://scope-stage.scholastic.com/issues/090113/narrative-nonfiction
/******EXPAND AND COLLAPSE BUTTONS******/
.expandingBtn img {
float:right;
background-image:('expandBtn.png');
margin-right:115px;
margin-top:-13px;
clear:both;
}
and my markup:
<h3 class="colorScheme">
Complexity Factors</h3>
<div class="expandingBtn">
<img src="/resource/uploads_scope/img/expandBtn.png" /></div>
<p>
See how this text will challenge your students.</p>
<!--THIS SECTION WILL BE HIDDEN UNTIL A THE EXPAND BUTTON IS CLICKED-->
<div class="hidden">
<h4>
Purpose</h4>
<p class="times">
The article has a clear purpose—to inform readers about how a brave teenager stood up to the Taliban—as well as an implicit purpose—to show how just getting an education is difficult for many young people around the world.</p>
<h4>
Knowledge Demands</h4>
<p class="times">
Comprehension will be aided by knowledge of current world events and geography. The major topics (free speech, the Taliban, terrorism, girls’ education worldwide, fighting oppression) will be unfamiliar to many students.</p>
<h4>
Language Conventionality and Clarity:</h4>
<p class="times">
<strong>Vocabulary:</strong> Many higher academic vocabulary words (e.g., oppressive, pseudonym, unwittingly)</p>
<p class="times">
<strong>Figurative language:</strong> Includes personification (“fear was her constant companion”) and metaphor (Malala’s voice is likened to a weapon)</p>
<h4>
Structure</h4>
<p class="times">
A nonlinear structure that starts in 2012 then goes back to 2007 and then forward to 2013. Includes narrative and informational passages.</p>
</div>
<!--THIS ENDS THE FIRST HIDDEN SECTION-->