vertical-alignment

Wrong rendering of <sup> in table with valign=top in Chrome and Safari

烈酒焚心 提交于 2019-12-06 05:51:32
问题 I have the following HTML: <p style="font-family:Verdana">test<sup>2</sup></p> <p style="font-family:Verdana;vertical-align:top">test<sup>2</sup></p> The problem is that in the second the <sup> is no longer positioned above the text but a few pixels lower. In essence the vertical-align:top raises all text except the superscripted to the top: This doesn't happen in Firefox, Opera but in Chrome and Safari (all Windows) and not with some fonts (like Times New Roman). Do you think this is a

CSS vertical-align:middle not working in IE7

。_饼干妹妹 提交于 2019-12-06 05:01:08
I have the this piece of code here... <div class="pics2"> <div style="position: absolute; top: 0px; left: 0px; display: block; z-index: 4; opacity: 1; width: 225px; height: 200px;"> // this div is generated via jQuery Plugin <div style="display:table-cell; vertical-align:middle; height:200px;"> <img src="upload/<?php echo $array['image5'] ?>" width="225" /> </div> </div> </div> and here is the CSS .pics2 { padding: 0; margin-left:20px auto; margin-right:20px auto; width:225px; height:200px; overflow:hidden; float:left; } .pics2 div{ width:225px; height:200px; } .pics2 img { background-color:

Bootstrap 3 / CSS: How to properly vertically align in panel heading

雨燕双飞 提交于 2019-12-06 03:33:32
问题 I use Bootstrap 3 to create panels with a structure like the below and would like to vertically align the span within the panel heading and without extending the default height of the panel heading. I tried different approaches (adding class="clearfix" , adding style="vertical-align:middle !important;" adding style="overflow:hidden !important;" etc.) but they are all either ignored or they increase the default height of the panel heading. My guess is that this is due to the "pull-right" class

How to use vertical-align: middle; properly?

佐手、 提交于 2019-12-05 23:53:47
I want to have my list (nav) align to the center of an image (logo). I tried using vertical-align: middle; , but I couldn't get it to work when I floated the images left and right. Here's my code: HTML: <div id="head"> <img id="logo" src="logo.png" /> <ul id="nav"> <li><a href="#">Item 1</a></li> <li><a href="#">Item 2</a></li> <li><a href="#">Item 3</a></li> </ul> </div> CSS: #head { margin-top: 2px; width: 100%; } #logo { float: left; } ul#nav { float: right; } ul#nav li { display: inline; list-style-type: none; } I took all the vertical-align: middle; 's from where I put them (I tested it

How to vertically align text across browsers

白昼怎懂夜的黑 提交于 2019-12-05 21:07:37
Please note that I have been through the existing links on this topic and none seem to help in my case. All suggest a way of how to move the text vertically so that it appears aligned. The problem in my case is that it is already aligned in Chrome, so when I try to align the text for Firefox then it misaligns the text in Chrome. Please open the following link in Firefox (v12) and Chrome (v19). http://jsfiddle.net/UQ4D5/ You will notice that it is shifted towards the top in Firefox but is perfectly aligned in Chrome. Two properties in your css display: table-cell; vertical-align: middle; Check

How to vertical-align text that runs multiple lines

旧巷老猫 提交于 2019-12-05 17:45:11
I realise there have probably been a few questions with a title similar to this, but I think my question is a little different, I've tried to do some background reading and can't seem to find an elegant solution to this anywhere (although that's possibly because one doesn't exist) Basically, I have three boxes, each with an image to the left, and some text in them, the problem is getting the text to vertical-align, having done some background reading on how vertical-align actually works (I wasn't entirely sure before) I tried implementing it to solve the problem, and it works perfectly well on

Vertically align smaller bullets with larger text

只愿长相守 提交于 2019-12-05 13:28:51
问题 I have a list with bullets. I made the bullets smaller by putting the li text inside a span and making the font-size of the li smaller than that of the span. The problem is that now the bullets are not vertically aligned in relation to the text. How do I fix that? HTML: <ul> <li><span>text1</span></li> <li><span>text2</span></li> <li><span>text3</span></li> <li><span>text4</span></li> </ul> CSS: li{ font-size: 15px; } li span{ font-size: 25px; } jsFiddle: http://jsfiddle.net/tXzcA/ 回答1: You

HTML5/CSS align list-items depending on other columns mutual height

纵然是瞬间 提交于 2019-12-05 12:46:36
I got the following use case: You can see three identical boxes: Each box beginns with a big rectangle box, that has a picture and variable content and thus has variable height. the rest consists of a list, that is vertical aligned bottom, so that they should get the same height. My goal is to "synchronize" the height of the < li >'s in each of these boxes. So it should not be important how many text you enter in such a < li > tag, the design should automatically handle the word-break and align the content like it was a row. In other words, like Abhitalks stated, I want to align list-items to

How do I vertically align a div inside a table cell?

不打扰是莪最后的温柔 提交于 2019-12-05 11:59:16
问题 How do I vertically center a div that is inside a table cell? HTML: <tr class="rowClass"> <td class="cellClass"> <div class="divClass">Stuff</div> </td> </tr> CSS: .rowClass { vertical-align:middle !important; height:90px; } .cellClass { vertical-align:middle !important; height:90px; } .divClass { vertical-align:middle !important; height:90px; } I know the class definitions are redundant, but I've been trying lots of different things. Why isn't the solution (whatever it is) intuitive. None of

How can you create a vertical navbar with drop down menus?

不打扰是莪最后的温柔 提交于 2019-12-05 08:28:47
I have a vertical navbar. Now, this navbar is supposed to have drop down menus. The only problem for me is, I am unable to make it so that the drop down menus are to the side of the menu. I have the HTML and CSS code on jsFiddle here: http://jsfiddle.net/maxkoenig/ZYUeX/ Here it is if you don't want to go on the website: HTML: <div id="wrap"> <ul class="navbar"> <li><a href="/index.php">Home</a></li> <li><a href="/boattypes/featureboats.php">Boat Types</a> <ul> <li><a href="/boattypes/sprint/sprint.php">Sprint</a></li> <li><a href="/boattypes/fitnesstouring/fitnesstouring.php">Fitness-touring<