html - How do I display an empty div tag with CSS? -


how force empty div tag show? have add   in div show. there way force display using css?

<div class="bar bg-success" title="2015-07-23,5.0000" height="50%"></div>  .bar {   background: green;   width: 5px;   float: left;   position: relative; } 

i tried adding

.bar:after {   content: " "; }  

but didn't help.

fiddle: http://jsfiddle.net/cf0gprln/
bootply: http://www.bootply.com/tnjkapio7l


please ignore below answers saying set height in css. height has set dynamically. &nbsp; makes display.


sorry realize made mistake height style. i'm not sure thinking. however, still doesn't work with:

<div class="bar bg-success" title="2015-07-23,5.0000" style="height: 50%;"></div> 

i see works in jsfiddle, not bootply. it's problem bootstrap. since question changed, i'll re-enter different question. updated bootply inline style: http://www.bootply.com/0apacbxmwp

it work! :) have add height well! :)

you can view updated fiddle here: http://jsfiddle.net/cf0gprln/1/

edit

i see added height html. reason not working because styling whole div. class on other hand kind of separate, , height , width both need defined there. either there, or in html self.


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -