[wp-trac] [WordPress Trac] #35107: wp_nav_menu outputs tags without line breaks in 4.4, causes strange bug with justified text
WordPress Trac
noreply at wordpress.org
Wed Dec 16 18:43:11 UTC 2015
#35107: wp_nav_menu outputs tags without line breaks in 4.4, causes strange bug
with justified text
----------------------------------------+-----------------------
Reporter: wp-architect | Owner: obenland
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 4.4.1
Component: Menus | Version: 4.4
Severity: normal | Resolution:
Keywords: needs-patch good-first-bug | Focuses: template
----------------------------------------+-----------------------
Comment (by wp-architect):
Replying to [comment:2 DoodleDogCody]:
> Would like to add to this with code example of why this is a problem.
On a number of mys sites I do the following
>
>
> {{{
> .nav-primary ul.menu-primary {
> text-align: justify;
> }
> .nav-primary ul.menu-primary::after {
> content: " ";
> display: inline-block;
> width: 100%;
> }
> }}}
>
> This has the effect of evenly spacing the nav menu items within their
container. This only works when there is space between the <li> tags
because justify only works if there are multiple words or in this case
elements for it to justify.
Thanks for mentioning that @DoodleDogCody - this is actually the exact
method I am using. It works fairly well as an approach to responsive
layout since Flexbox is still not widely adopted by browsers. Switching
over to floats in an option but requires careful calculations when it
comes to padding/margins between elements whereas text-align:justify
figures it out for you.
For some added context, here is an article which further explains this
approach. [http://www.barrelny.com/blog/text-align-justify-and-rwd/]
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35107#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list