來自

2017-02-19 26 views
0

的獨立figate文字設置我有以下段落,圖像在側面,我需要在每張圖片上都有一個「figcaption」。我需要設置獨立設置的「figcaption」文本。我怎樣才能做到這一點?來自

此外,我不知道,如果figcaption標記在我的HTML正確使用:

<p><figure><span class="image right"><img src="images/scania_old.jpg" alt="Stoptrans first truck" /><figcaption>Stoptrans first truck in the 80's</figcaption></span></figure>Vestibulum ultrices risus velit, sit amet.</p> 

Example Image

我image.right和image.left類有這樣的設置:

.image.right { 
      float: right; 
      margin: 0 0 1em 1.5em; 
      top: 0.25em; 
     } 

.image.left { 
      float: left; 
      margin: 0 1.5em 1em 0; 
      top: 0.25em; 
     } 

而且我需要我的無花果使用此設置:

  font-size: 75%; 
      font-style: italic; 
      text-align: center; 

回答

0

您可以像處理任何其他標記一樣對待figcaption標記,方法是將style應用於figcaption類型標記或在您的html中爲其提供class屬性。

應用風格figcaption:

figcaption { 
font-size: 75%; 
font-style: italic; 
text-align: center; 
} 

使用類屬性:

<figcaption class="example">Stoptrans first truck in the 80's</figcaption> 

.example { 
font-size: 75%; 
font-style: italic; 
text-align: center; 
}