2017-08-27 89 views
2

我正在閱讀Jon Duckett的HTML和CSS,並且正在學習CSS background-repeat屬性。現在CSS`background-repeat`屬性

enter image description here

,我公司生產從background-repeat在下面的代碼段中的代碼。

body { 
 
    background-image: url("https://image.ibb.co/gE9g95/header.gif"); 
 
    background-repeat: repeat-x; 
 
    color: #665544; 
 
    padding: 20px; 
 
} 
 

 
h1 { 
 
    color: white; 
 
}
<!DOCTYPE html> 
 
<html> 
 

 
<head> 
 
    <title>Background Image (Body)</title> 
 
</head> 
 

 
<body> 
 
    <h1>Planting Guide</h1> 
 
    <h2>Magnolia</h2> 
 
    <p><b><i>Magnolia grandiflora</i></b>, commonly known as the <b>Southern magnolia</b> or <b>bull bay</b>, is a tree of the family Magnoliaceae native to the southeastern United States, from coastal Virginia south to central Florida, and west to eastern 
 
    Texas and Oklahoma. Reaching 27.5 m (90 ft) in height, it is a large striking evergreen tree with large dark green leaves and large white fragrant flowers. Widely cultivated around the world, over a hundred cultivars have been bred and marketed commercially. 
 
    The timber is hard and heavy, and has been used commercially to make furniture, pallets, and veneer.</p> 
 
    <h2>Ranunculus</h2> 
 
    <p><b><i>Ranunculus asiaticus (Persian Buttercup)</i></b> is a species of buttercup (Ranunculus) native to the eastern Mediterranean region in southwestern Asia, southeastern Europe (Crete, Karpathos and Rhodes), and northeastern Africa. It is a herbaceous 
 
    perennial plant growing to 45 cm tall, with simple or branched stems. The basal leaves are three-lobed, with leaves higher on the stems more deeply divided; like the stems, they are downy or hairy. The flowers are 3-5 cm diameter, variably red to 
 
    pink, yellow, or white, with one to several flowers on each stem.</p> 
 
    <h2>Tulip</h2> 
 
    <p><b><i>Tulipa gesneriana L. or "Didier's tulip"</i></b> is a plant belonging to the family of Liliaceae. This species has uncertain origins, possibly from Asia, and has become naturalised in south-west Europe. Most of the cultivated species, subspecies 
 
    and cultivars of tulip are derived from Tulipa gesneriana. The flower and bulb can cause dermatitis through the allergen, tuliposide A, even though the bulbs may be consumed with little ill-effect. The sweet-scented bisexual flowers appear during 
 
    April and May. Bulbs are extremely resistant to frost, and can tolerate temperatures well below freezing - a period of low temperature is necessary to induce proper growth and flowering, triggered by an increase in sensitivity to the phytohormone 
 
    auxin. The bulbs may be dried and pulverised and added to cereals or flour.</p> 
 
</body> 
 

 
</html>

現在,我的問題是這樣的 - 做的background-image屬性,默認情況下,重複(或「鑲嵌」)沿元件頂部的圖像(在這種情況下, body元素)?

回答