html - how to format a button on each side of an H3 tag -


plan

[button] [h3] [button] 

html

<span class="glyphicon glyphicon-chevron-left"></span> <h3>title may or may not long enough break new line</h3> <span class="glyphicon glyphicon-chevron-right"></span> 

should simple right? keep ending either

[button] [h3] [button] 

or

[button] [h3] [button] 

example: http://jsfiddle.net/s9x2kxyz/

there more ways it, above fiddle shows 1 way that's simple:

html:

<span class="glyphicon glyphicon-chevron-left"></span> <h3>title may or may not long enough break new line</h3> <span class="glyphicon glyphicon-chevron-right"></span> 

css:

h3, span {display:block;float:left;text-align:center;} h3 {width:80%;margin-top:10px;} span {width:10%;margin-top:15px;} 

the vertical alignment part can tricky when don't know how many lines there may on h3, that's nature of beast in case...the margin-top in example showing how can control bit...it need vary based on size of font, etc. hope helps point in right direction.

edit: wanted note, i've used original html purpose of answering question, depending on being used for, elements here should contained in <a> (or <button>)element bit more semantic, , css in solution on <a> instead of span. main benefit normalize behavior across browsers , devices if happening when clicking/hovering/focusing elements.


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -