2017-11-12 17 views
0

1つのdivに段落とイメージがあり、イメージの上部余白を調整してページの上部の代わりに少し上になるようにしています画像はあなたがを与えることができdiv内の2つの要素の高さを調整する


#aboutmetext{ 
 
    font-family:avenir,calibri; 
 
    font-size:30px; 
 
    color:white; 
 
    text-shadow:2px 2px 5px black; 
 
    width:45%; 
 
    float:left; 
 
    margin-left:5%; 
 
    margin-top:0%; 
 
    } 
 

 
    #picture{ 
 
    float:right; 
 
    margin-right: 10%; 
 
}
<div> 
 
\t <p id="aboutmetext"><b>I am a visual effects & motion graphics 
 
    artist with a Bachelor of Science degree from The Art Institute of 
 
    Pittsburgh. My focus is in motion graphics and graphic design.</b></p> 
 
\t <img src="http://moroccodunes.com/img/tours/14290060392.jpg" id="picture" class="bigEntrance" width="500px" 
 
    border="5" style="border-color:white;padding:5px"> 
 
    </div> 
 

 

enter image description here

答えて

0

段落の先頭に揃えは、この

#aboutmetext{ 
 
    font-family:avenir,calibri; 
 
    font-size:30px; 
 
    color:white; 
 
    text-shadow:2px 2px 5px black; 
 
    width:45%; 
 
    float:left; 
 
    margin-left:5%; 
 
    margin-top:0%; 
 
    } 
 

 
    #picture{ 
 
    float:right; 
 
    width:45%; 
 
    margin-top:-50px;/* define the negative margin to your need */ 
 
}
<h1>This is the title</h1> 
 
<div> 
 
\t <p id="aboutmetext"><b>I am a visual effects & motion graphics 
 
    artist with a Bachelor of Science degree from The Art Institute of 
 
    Pittsburgh. My focus is in motion graphics and graphic design.</b></p> 
 
\t <img src="http://moroccodunes.com/img/tours/14290060392.jpg" id="picture" class="bigEntrance" 
 
    border="5px" style="border-color:white;padding:5px"> 
 
    </div>

を試してみてください
関連する問題