Does anybody know how to center align a DIV that has the display set to inline-block?
由于我有需要重复的背景形象,而且需要根据内容加以扩大,我无法把展示放开。 它坐在母体内,当到血缘时,则更大。
因此,这一切都是如此。 是否有任何固定点能够把iv与固定锁的显示相匹配?
无,文字版:中心;不工作,也不差:零
jsFiddle: http://jsfiddle.net/HkvzM/
谢谢!
Does anybody know how to center align a DIV that has the display set to inline-block?
由于我有需要重复的背景形象,而且需要根据内容加以扩大,我无法把展示放开。 它坐在母体内,当到血缘时,则更大。
因此,这一切都是如此。 是否有任何固定点能够把iv与固定锁的显示相匹配?
无,文字版:中心;不工作,也不差:零
jsFiddle: http://jsfiddle.net/HkvzM/
谢谢!
使用:
margin: 0 auto;
Or text-align: Center;
on the parent <div>
.
亲爱的亲子关系中心不像儿童那样,
<>Cs
div{
text-align: center;
}
.dl{
color: #fff;
margin: 0 auto;
background: #000;
text-transform: uppercase;
font-size: 14px;
font-weight: bold;
line-height:35px;
display:inline-block;
}
<><><><>>><>>>>><>>>>>>>
<div>
<a class="dl">DOWNLOAD NOW DOWNLOAD NOW DOWNLOAD NOW</a>
</div>
You can not center an element with
display:inline
你可能不得不利用 j或 Java本在周围找到工作。 如果案文不作长篇改动,你可以与安保部做一些大致的工作。 http://jsfiddle.net/HkvzM/16/“rel=“nofollow”
<div id="out">
<a class="dl">DOWNLOAD NOW DOWNLOAD NOW DOWNLOAD NOW</a>
</div>
#out{
padding:0 50px;
}
text-align:center on the parent div , will simply do the trick.
source : CSS center display inline block?
What I ve gotten from all of these (many, multitude, gobs of) answers is that you cannot center a block with an inline style call. It must be a defined class. Here s the canary:
<div
style="font-size: 14pt; text-align: center; font-family: latoweb; font-weight: 400; display: inline-block; margin: 0 auto; width: 80%; height: auto;"
>
<a
id="media_comment_m-4JGUVJ6vm4uhihPBSiXrZGRG2Fm1a8To"
data-media_comment_type="video"
class="instructure_inline_media_comment video_comment mce-item-anchor"
data-alt=""
>
</a>
5 Quick Steps to <i>Photo Story 3</i>
</div>
Trying to center a video frame inside of Canvas LMS. Must pass their whitelist test.
I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....
I have a div <div id="masterdiv"> which has several child <div>s. Example: <div id="masterdiv"> <div id="childdiv1" /> <div id="childdiv2" /> <div id="...
I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...
<form><input type="file" name="first" onchange="jsFunction(2);"> <input type="file" name="second" onchange="jsFunction(3);"</form> Possible to pass just numbers to the js ...
So I ve got a menu with a hover/selected state and it loads fine in IE6/IE7. However when I scroll down the page and put the element outside of the viewport and then back in I get a broken image! I ...
I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...
Is it possible to reload a form after file-input change? I have a form where the user can chose an image for upload. I also have a php script which displays that image resized. I only wonder if it ...
I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!