How to center the center circle?
Tags: css3,vertical-alignment,centering,alignment
Problem :
How to center the center circle (CSS only)? [Assume latest CSS3 browser support.]
Must maintain v/h centering when parent w/h changes dynamically.
Would the experimental CSS Box Model spec help here?
Thanks.
http://jsfiddle.net/dragontheory/VdJFa/5/
<div class="parent">
<div class="middle">
<div class="circle">
<div class="circle"></div>
</div>
</div>
</div>
.parent {display: table;
margin: 50px auto;
background: lightgray;
height: 100px;
width: 100px;}
.middle {display: table-cell;
vertical-align: middle;}
.circle {margin: auto;
border: solid 10px blue;
border-radius: 50%;
opacity: 0.3;
width: 50px;
height: 50px;}
.circle .circle {width: 15px;
height: 15px;}
Solution :
You need to give your middle container, appropriate padding
,It will help bringing the content to the center.
You can achieve the same by giving a left
i.e. making your .middle
as:
.middle {
vertical-align: middle;
text-align:center;
left:10%;
position:relative; /*makes left effective*/
display:table-cell;
}
Also, you have to give your child div.circle
a specific width
and height
combined with border-radius
to align it and to give it a shape of circle.
And finally you need to play with the margin of the inner circle to align it.
see this fiddle
CSS Howto..
You can set a variable of $menu-icon-items:"\f007","\f07c","\f1fa"; and loop through using its length, see example here: HTML <div class="menu-item1">1</div> <div class="menu-item2">2</div> <div class="menu-item3">3</div> SCSS $menu-icon-items:"\f007","\f07c","\f1fa"; @for $i from 1 through...
You can use transform: rotate(90deg) ; -webkit-transform: rotate(90deg) ; -moz-transform: rotate(90deg) ; -o-transform: rotate(90deg) ; -ms-transform: rotate(90deg) ; See http://jsfiddle.net/poselab/54XvF/ CSS3 MAKER is a good tool to create your css...
The short answer is that you can't. This image from MDN's explanation about stacking context explains it well: There has been talk about escaping stacking context using position: fixed but it...
.submenutwo { display: none } .submenu:hover .submenutwo { display: initial } Here's how you can do it in css. Basically, what's happening here is. At first, you just need to...
Go to your application settings on Facebook you will find canvas settings In the canvas settings you will find IFrame Size: You will find two options Show scrollbars Auto-resize select...
I think this is the effect you want. CSS doesn't allow you to get the height of an element to use in calc() for positioning and margins, so a little...
Have a look at these three slideshare presentations to start: Beautiful Maintainable CSS Maintainable CSS Efficient, maintainable, modular CSS Firstly, and most importantly, document your CSS. Whatever method you use...
This is the right way dialogBox.setPopupPositionAndShow(new PositionCallback(){ @Override public void setPosition(int offsetWidth, int offsetHeight) { // TODO Auto-generated method stub dialogBox.setPopupPosition(parentDockLayoutPanel().getOffsetWidth()- dialogBox.getOffsetWidth(),...
IE7 Dropdown As Sotiris mentioned, the easiest fix for IE7 would be to give ul#menu > li > ul a fixed width. This would cause the child <li> and <a>...
It's because div's are displayed as block by default. To fix your issue add display: inline-block to the div's containing select. Add below code to your CSS. .profileField .select{ display:...
flexbox can do that. * { box-sizing: border-box; } .container div { height: 75px; border:1px solid grey; } .container { display: flex; } .variable { background: lightgreen; flex: 1 0...
<div [class.icon_heart]="!showheartIconRead" [class.icon_heart_red]="showheartIconRead"> or <div [ngClass]="showheartIconRead ? 'icon_heart_red' : 'icon_heart'"> ...
After doing lots of research and development; there is basically nothing standard out there for a JS based solution. I checked Dojo, Sencha and some others paid stuff. At the...
You've got an a tag containing an img tag. That's your normal state. You then add a background-image as your hover state, and it's appearing in the background of your...
You can do this without JavaScript: .select-bldg-btn { display: none; } .select-bldg-listing:hover .select-bldg-btn { display: inline-block; } ...
I believe you're looking for "preventDefault". Try something like this for your JS: $('#wrk').click(function(evt) { evt.preventDefault(); $(".workDropUL").show(); }); Edit: Here's the article about preventDefault() on the jQuery API site: http://api.jquery.com/event.preventdefault/...
you can get left margin of the div this way: $("#top").css("margin-left"); ...
You can set to span looked like h1 and do something like this: code: <html> <head> <style> .img { display: none; } .show:hover + .img { display: block; } <style>...
Use this css #yin-yang { width: 96px; height: 48px; background: #eee; border-color: red; border-style: solid; border-width: 2px 2px 50px 2px; border-radius: 100%; position: relative; } #yin-yang:before { content: ""; position:...
The basic premise is to generate positional values, and use jquery's animate() function to move the div. The calculation of the next position is simple, you just need a bit...
I think you just described a block level element. It will wrap when the browser is resized.
It is happening because your css is only for the th tag. You should add css for td as well: #mytbody > tr > th, #mytbody > tr > td...
Here it is: Wrap the template code inside a div (I give it the ID #gradient), then set width and height for it. Other things are the same as on...
What you need isn't floating but the style white-space: nowrap; Apply the nowrap on your container and set your items to display inline. Refer to the jsfiddle below. Here is...
This can not be done through media queries, at least not your question. First step You need only one html file but 2 sets of javascript and css files. One...
for transition backgrounds use the property background-size, and use background-position to adjust as fits you better body { margin: 0 } .myimage01 { background-size: 100%; background-position:center center; -webkit-transition: .3s ease-in-out;...
Sadly I think this is impossible. Each character in a font has a specific shape. In addition, similar characters in different weights weights are also distinct—a bold character does not...
jQuery $("#id").css({"width":"74px", "height":"99px", "background":"url(images/icons.png) -0px -0px"}); ...
It's likely that your document is appearing in Quirks Mode when being served from the server. When Internet Explorer renders a document in Quirks Mode, it no longer supports many...
I suggest using the Chrome browser, right click the modal and 'inspect it'. From there on the bottom in the right hand column you'll see all the CSS that makes...