Why doesn't my div inside a span work properly?
css, html
Solution
Your markup is incorrect ( plus missing semi-colon as quoted by Steini, mentioning this for sake of completeness of answer )
Answer 1 : `span` is an `inline` element, so having a `div` inside `span` is a bad idea, also, it would be better, if you nest `span` inside `span` and give inner span `display:block` property!
Answer 2 : add `display:block` to `span` to change the default behavior
working fiddle with correct markup
fiddle with the layout you wanted
Problem
I'm writing the following `HTML` markup: ``` <span> Some Text <div id="ch">татата</div> </span> ``` and styles: ``` span{ border: 1px solid black; text-align:center; width: 300px; height: 300px; background: aqua; } #ch{ width:100px; height:100px background: yellow; } ``` jsFiddle - Why is the `height` property not applied to a `div` element which inside the `span`, but width is applied? - Why is the right border of my `span` is missing?