html - What's a better way to have two short divisions of text, one on the left and one on the right? -


In my website, headings often require some explanation text (for example a date) for their description. Current solution is & lt; Div & gt; Correct & lt; H1 & gt; or & lt; H2 & gt; , so that the header still clears the floating device right.

talk on the right

This is the only CSS that I have churned yet: h1, h2, h3, h4, h5, h6 {display: block; Width: Auto; } .right {float: right; }

and with HTML:

  & lt; Div class = "right" & gt; On the right & lt; / Div & gt; & Lt; H2 & gt; Talk to the left & lt; / H2 & gt;   

Whether a header and and

gt; Is there a way to format on the right, for which they will not need to be written backwards? And preferably dependent on the right-aligned diwi, or dependent there around an additional element, or wrapped in earlier or later, these two?

It seems really strange that only simple implementation is so far behind.

The comments of your two additional elements are being wrapped in a div, you can easily get it You can display the usage table for :

  .wrapper {display: table-row; } H1 ,. Additional {display: table-cell; }. Additional {text-align: right; Width: 100%; }   

When you consider that the float solution does not require additional cleanoffs , the markup is near the same.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -