我試圖用div
包裝img
。問題是圖像加載到div
的左側。我目前有一個圖像和div
,並知道圖像大小之前,它被加載。 div
尺寸設置爲圖像尺寸,但圖像加載到div的左側。我試過所有的東西,甚至在圖像上添加了一個垂直對齊,而我遇到的最接近的東西是將絕對的div
絕對位置加載到圖像正確的文本下面。我可能可以加載在原來的另一個div
圖像,但可能會損害SEO在我的情況。圖像的圖像不總是在DIV內
位置
HTML
<ul id="UL_1" class="ab-submenu">
<li id="LI_2">
<a class="ab-item" tabindex="-1" href="http://techdigy.com/wp-admin/profile.php" id="A_3"></a>
<div class="avatar-holder" id="DIV_4">
<img alt="" src="http://1.gravatar.com/avatar/95fef2e7b4a23f9cc0439619db1af0a6?s=64&d=identicon&r=G" class="avatar avatar-64 photo" height="64" width="64" id="IMG_5" />
</div><span class="display-name" id="SPAN_6">Andre</span>
</li>
<li id="LI_7">
<a class="ab-item" href="http://techdigy.com/wp-admin/profile.php" id="A_8">Edit My Profile</a>
</li>
<li id="LI_9">
<a class="ab-item" href="http://techdigy.com/wp-login.php?action=logout&_wpnonce=c7d2e50651" id="A_10">Log Out</a>
</li>
</ul>
CSS
#UL_1 {
background: rgba(0, 0, 0, 0) none repeat scroll 0px 0px/auto padding-box border-box;
border: 0px none rgb(204, 204, 204);
color: rgb(204, 204, 204);
font: normal normal normal 13px/28px sans-serif;
height: auto;
line-height: 28px;
list-style: none outside none;
margin: 0px;
outline: rgb(204, 204, 204) none 0px;
padding: 6px 0px;
position: relative;
text-align: left;
text-shadow: rgb(68, 68, 68) 0px -1px 0px;
transition: none 0s ease 0s;
width: auto;
z-index: 99999;
}/*#UL_1*/
#LI_2 {
background: rgba(0, 0, 0, 0) none repeat scroll 0px 0px/auto padding-box border-box;
border: 0px none rgb(204, 204, 204);
color: rgb(204, 204, 204);
font: normal normal normal 13px/28px sans-serif;
height: auto;
line-height: 28px;
list-style: none outside none;
margin: 6px 16px 15px 88px;
outline: rgb(204, 204, 204) none 0px;
position: relative;
text-shadow: rgb(68, 68, 68) 0px -1px 0px;
transition: none 0s ease 0s;
width: auto;
z-index: 99999;
}/*#LI_2*/
#A_3 {
background: rgba(0, 0, 0, 0) none repeat scroll 0px 0px/auto padding-box border-box;
border: 0px none rgb(33, 117, 155);
color: rgb(33, 117, 155);
display: block;
font: normal normal normal 13px/26px sans-serif;
line-height: 26px;
list-style: none outside none;
min-width: 140px;
outline: rgb(33, 117, 155) none 0px;
padding: 0px 12px 0px 8px;
text-align: left;
text-decoration: none;
transition: none 0s ease 0s;
white-space: nowrap;
}/*#A_3*/
#DIV_4 {
border: 0px none rgb(204, 204, 204);
color: rgb(204, 204, 204);
font: normal normal normal 13px/28px sans-serif;
height: 64px;
line-height: 28px;
list-style: none outside none;
outline: rgb(204, 204, 204) none 0px;
text-align: left;
text-shadow: rgb(68, 68, 68) 0px -1px 0px;
transition: none 0s ease 0s;
white-space: nowrap;
width: 64px;
}/*#DIV_4*/
#IMG_5 {
background: rgba(0, 0, 0, 0) none repeat scroll 0px 0px/auto padding-box border-box;
border: 0px none rgb(204, 204, 204);
color: rgb(204, 204, 204);
display: block;
font: normal normal normal 13px/28px sans-serif;
height: 64px;
left: -72px;
line-height: 28px;
list-style: none outside none;
outline: rgb(204, 204, 204) none 0px;
position: absolute;
text-align: left;
text-shadow: rgb(68, 68, 68) 0px -1px 0px;
top: 4px;
transition: none 0s ease 0s;
vertical-align: middle;
white-space: nowrap;
width: 64px;
}/*#IMG_5*/
#SPAN_6 {
background: rgba(0, 0, 0, 0) none repeat scroll 0px 0px/auto padding-box border-box;
border: 0px none rgb(51, 51, 51);
color: rgb(51, 51, 51);
display: block;
font: normal normal normal 13px/28px sans-serif;
height: 18px;
line-height: 28px;
list-style: none outside none;
outline: rgb(51, 51, 51) none 0px;
text-align: left;
transition: none 0s ease 0s;
white-space: nowrap;
}/*#SPAN_6*/
#LI_7, #LI_9 {
background: rgba(0, 0, 0, 0) none repeat scroll 0px 0px/auto padding-box border-box;
border: 0px none rgb(204, 204, 204);
color: rgb(204, 204, 204);
font: normal normal normal 13px/28px sans-serif;
height: auto;
line-height: 28px;
list-style: none outside none;
margin: 0px 16px 0px 88px;
outline: rgb(204, 204, 204) none 0px;
position: relative;
text-shadow: rgb(68, 68, 68) 0px -1px 0px;
transition: none 0s ease 0s;
width: auto;
z-index: 99999;
}/*#LI_7, #LI_9*/
#A_8, #A_10 {
background: rgba(0, 0, 0, 0) none repeat scroll 0px 0px/auto padding-box border-box;
border: 0px none rgb(33, 117, 155);
color: rgb(33, 117, 155);
display: block;
font: normal normal normal 13px/26px sans-serif;
height: 26px;
line-height: 26px;
list-style: none outside none;
min-width: 140px;
outline: rgb(33, 117, 155) none 0px;
padding: 0px 12px 0px 8px;
text-align: left;
text-decoration: none;
transition: none 0s ease 0s;
white-space: nowrap;
}/*#A_8, #A_10*/
請張貼一些相關的HTML/CSS來證明這一點。 –
當然。一秒。 –
「我可能可以將圖片加載到原始內容的另一個div中,但這可能會損害我的案例中的SEO。」 - 我可以向你保證,它不會 – Adam