center-align

How to center an iframe horizontally?

≡放荡痞女 提交于 2019-11-27 10:24:12
Consider the following example: ( live demo ) HTML: <div>div</div> <iframe></iframe> CSS: div, iframe { width: 100px; height: 50px; margin: 0 auto; background-color: #777; } Result: Why the iframe is not centrally aligned like the div ? How could I centrally align it? Add display:block; to your iframe css. best way and more simple to center an iframe on your webpage is : <p align="center"><iframe src="http://www.google.com/" width=500 height="500"></iframe></p> where width and height will be the size of your iframe in your html page. HTML: <div id="all"> <div class="sub">div</div> <iframe>ss<

android center align the selected tab in tablayout

♀尐吖头ヾ 提交于 2019-11-27 09:06:47
I am using android support design tablayout. Here's my code: <android.support.design.widget.TabLayout android:id="@+id/tabs" android:layout_width="match_parent" android:layout_height="wrap_content"" app:tabGravity="center" app:tabMode="scrollable" /> <android.support.v4.view.ViewPager android:id="@+id/view_pager" android:layout_width="match_parent" android:layout_height="match_parent" /> My issue is the tabs always align left. However, I would like to center the selected tab (even at the beginning, the first(selected) tab should be centered). Is there a way to do this? Thanks. I took a look

Center Align title in action bar using styles in android.

自作多情 提交于 2019-11-27 01:36:25
Hi I am developing android application. In my application I am using action bar. I want to make center align my title of window in action-bar. I know it is possible using xml files. but I want to do it using style so that it will applicable for my every window, how to do this need help. Thank you. SBerg413 I know it is possible using xml files. but I want to do it using style so that it will applicable for my every window, how to do this need help. You still use xml to do this. Just apply the style application wide and not just to a single activity. Please see the android documentation for a

Align a div to center

旧时模样 提交于 2019-11-26 18:00:47
问题 I want to float a div to center. Is it possible? text-align: center is not working in IE. 回答1: There is no float to center per se. If you want to center a block element inside another do this: <div id="outer"> <div id="inner">Stuff to center</div> </div> with: #outer { width: 600px; } #inner { width: 250px; margin: 0 auto; } Now that won't make the text wrap around it (like it would with a float left or right) but like I said: there is no float center. 回答2: This has always worked for me.

Center Align title in action bar using styles in android.

六月ゝ 毕业季﹏ 提交于 2019-11-26 17:28:40
问题 Hi I am developing android application. In my application I am using action bar. I want to make center align my title of window in action-bar. I know it is possible using xml files. but I want to do it using style so that it will applicable for my every window, how to do this need help. Thank you. 回答1: I know it is possible using xml files. but I want to do it using style so that it will applicable for my every window, how to do this need help. You still use xml to do this. Just apply the

How to center an iframe horizontally?

谁说我不能喝 提交于 2019-11-26 15:07:59
问题 Consider the following example: (live demo) HTML: <div>div</div> <iframe></iframe> CSS: div, iframe { width: 100px; height: 50px; margin: 0 auto; background-color: #777; } Result: Why the iframe is not centrally aligned like the div ? How could I centrally align it? 回答1: Add display:block; to your iframe css. 回答2: best way and more simple to center an iframe on your webpage is : <p align="center"><iframe src="http://www.google.com/" width=500 height="500"></iframe></p> where width and height