center

page will not align center

為{幸葍}努か 提交于 2019-12-02 02:08:43
I have got a css problem. http://www.luukratief-design.nl/dump/parallax/index.html I cant get this page to align center. Before i get the answer to use "text-align: center;" on the body, i already did. The page 100% validates (CSS and HTML). Please help, never had this before. Set the left and right margins of the #wrapper div to auto #wrapper{ margin:0 auto; } to align a page in the center you can place all the content of the page inside a container div and set these css properties body { text-align: center; //for ie 6 } #main_wrapper { text-align: left; width: 1000px; //any width you want

Calculating the center of rotation after translation

感情迁移 提交于 2019-12-02 00:51:08
I need to be able to rotate an image around a given point so that what ever part of the image appears in the center of my container is the center of rotation. To calculate the center points, I am currently just taking the inverse of the translation applied to the image: Rotate.CenterX = Translate.X * -1; Rotate.CenterY = Translate.Y * -1; However, the current calculation i'm using is not sufficient as it does not work if the image has been translated after being rotated. I'm sure it's a reasonably straight forward trig function, I just can't think what it is! Cheers If you are working with GDI

Can't get my navigation menu in the center of the page

∥☆過路亽.° 提交于 2019-12-02 00:37:51
The navigation menu is not centered. I have tried many methods of getting it to be centered, but none worked. HTML <div id="nav-bar"> <li> <a href="index.html">Home</a> </li> <li> <a href="servicii.html">Servicii</a> </li> <li> <a href="portofoliu.html">Portofoliu</a> </li> <li> <a href="contact.html">Contact</a> </li> CSS #nav-bar li a { color: #000; text-decoration: none; list-style-type: none; font-size: 14px; font-family: "Myriad Pro", "Myriad Pro Cond", "Myriad Pro Light", Arial, sans-serif; font-weight: bold; #nav-bar { text-transform: uppercase; list-style: none; padding: 23px 0 23px 0;

Fieldset: Center legend

一曲冷凌霜 提交于 2019-12-02 00:00:16
as asked many times before (but never really answered) I want to center a legend in a fieldset. The trick was done perfectly here, which I also bought for my project: http://themeforest.net/item/aloma-liquid-mobile-template/full_screen_preview/5819068 the code from the css reads like this fieldset { display: block; margin: 20px 1%; margin-bottom: 20px; padding: 0 auto; padding: 15px 0; border: 0; border-top: 1px solid #DDD; width: 98%; } legend { display: table; min-width: 0px; max-width: 70%; position: relative; margin: auto; padding: 5px 20px; color: #eee8aa; font-size: 20px; text-align:

CSS center any image in div

旧巷老猫 提交于 2019-12-01 23:31:13
问题 Lets say I have div with width: 300px and height: 200px I want any image inside this div to be centered both horizontally and vertically no matter if image is bigger or smaller than div ; For smaller images margin: 0 auto works well but higher image protrude to the right and isn't centered. For bigger images this works: height: 100%; top: 50%; left: 50%; transform: translate(-50%, -50%); I couldn't find any combination of those and didn't find any solution how to perfectly center this image.

vertical center an image without knowing dimensions

孤人 提交于 2019-12-01 20:11:26
问题 I have centered a lot of stuff in my webdevelopment career, but I was wondering if there is a simple way to centering an image vertically without knowing the image's dimensions. Imagine a thumbnail list I get from the database. I don't want every item to be sticking to the top of the parent div. <div id="wrapper"> <div id="parent"> <img src="path/i/got/from/database/image.png" /> </div> </div> 回答1: You could use this CSS on your parent: #parent { display:table-cell; vertical-align:middle; }

vertical center an image without knowing dimensions

六眼飞鱼酱① 提交于 2019-12-01 19:17:53
I have centered a lot of stuff in my webdevelopment career, but I was wondering if there is a simple way to centering an image vertically without knowing the image's dimensions. Imagine a thumbnail list I get from the database. I don't want every item to be sticking to the top of the parent div. <div id="wrapper"> <div id="parent"> <img src="path/i/got/from/database/image.png" /> </div> </div> You could use this CSS on your parent: #parent { display:table-cell; vertical-align:middle; } Note that this will make the parent element behave like an inline element. Example . If your design doesn't

How do I center a horizontal control group in the footer - changed in jqm 1.1.1?

a 夏天 提交于 2019-12-01 16:30:44
This used to work to center the controlgroup in 1.1.0, but now it seems like it doesn't in 1.1.1. <div data-theme="a" data-role="footer" style="text-align:center;"> <div data-role="controlgroup" data-type="horizontal" data-mini="true"> <a href="foo" data-role="button">link1</a> <a href="boo" data-role="button">link2</a> </div> <div class="copy">© 2012 bigco</div> </div> Probably align="center" attribute of data-role="controlgroup" div could be suitable for that. <div data-theme="a" data-role="footer" align="center"> <div data-role="controlgroup" data-type="horizontal" data-mini="true"> <a href

How do I center a <div>? [duplicate]

杀马特。学长 韩版系。学妹 提交于 2019-12-01 16:06:01
Possible Duplicate: How to center DIV in DIV? I want to center a <div> (I'm new to HTML5 and the <center> tag is no more), and by all means avoid using a table. This is what I've got as CSS for the <div> in question so far: #roundedcorner { -moz-border-radius: 15px; border-radius: 15px; background-image: url(file:///Macintosh%20HD/Users/julesmazur/Desktop/TAN3.0/Photos/bodydivbg.png); width: 960px; left: 50%; font-family: Ubuntu; } (for anyone curious, Ubuntu courtesy of Google Web Fonts). The typical trick is margin: auto . It'll center it inside what-ever it's in. demo Besides that I have a

Centering a css dropdown menu

你离开我真会死。 提交于 2019-12-01 13:37:50
I'm trying to center my css dropdown menu, but I can't seen to get it to work! I've tried adding text-align: center and margin-left: auto; margin-right: auto, but all that gets centered are the dropdown li-items. How is this done? Here's the css: .bg {background-color: #008503;} .menu {padding:0 0 0 32px; margin:0; list-style:none; height:30px; background-color: #1e52b8; position:relative; font-family: Helvetica, Verdana, sans-serif; } .menu li.top {display:block; float:left; position:relative;} .menu li a.top_link {display:block; float:left; height:30px; line-height:33px; color:#FFF; text