Posts: 260
Threads: 39
Joined: Jun 2014
2015-02-25, 01:08:44
(This post was last modified: 2015-02-25, 01:10:18 by Hypertexter.)
Hi,
in my responsive site I have a longer menu entry which consists of two words. So on some screen resolutions there is a line break between the two words.
I tried to put a " " into the menu text between the words, but it is not interpreted, but shown in the menu entry!
How can I get a nonbreaking space instead?
Thank you!
Hypertexter
This is not really a plugin question - but I cannot move it...
Posts: 260
Threads: 39
Joined: Jun 2014
2015-02-25, 02:30:10
(This post was last modified: 2015-02-25, 02:30:58 by Hypertexter.)
Seems there is no Unicode way... I managed to do it with
Quote:ALT + 0160
, which produces a
in HTML...
Posts: 23
Threads: 0
Joined: Aug 2013
I would try
#menu li { ...
white-space:nowrap;
...}
in the CSS template file (ID #menu li = the menu text) then the text is in one line.
Take care that the #menu width is dimensioned suitable that the text is within the menu item.
Thats all "volks"
PauliOpa
werrechtschreibfehlerfindetdarfsiebehalten
Posts: 260
Threads: 39
Joined: Jun 2014
Hello PauliOpa,
thank you for your post. I want to do it in the GUI, and the GUI seems to kill (or to print) all code trials...
Posts: 6,266
Threads: 181
Joined: Sep 2011
yeah spaces are usually not allow in line item, due to its white-space rules.
you can override this with css, but its not the ideal solution.
css margins and padding is probably the preferred solution.
oh sorry, word-break and whitespace
Posts: 23
Threads: 0
Joined: Aug 2013
2015-02-25, 05:31:29
(This post was last modified: 2015-02-25, 05:32:33 by PauliOpa.)
OK, but css margins and padding are already defined and you have to adjust the width to the longest item, as well.
I agree with using only one word in the item menu section, so that line-break problem does not arise. Would be the best solution. The adjustment of the width is nevertheless neccessary.
It also depends, if you are using horizontal or vertical menus. On horizontal menues you should use the nested menue plugin, because of limitation of number of items (in one line).
Using the GUI (admin backend) and defining the menue (you should use a single word in this box) is the best suitalbe solution. Here Line breaks occur only, when the words ar too long. Otherwise you should change the styles css accordingly.
Thats all "volks"
PauliOpa
werrechtschreibfehlerfindetdarfsiebehalten
Posts: 6,266
Threads: 181
Joined: Sep 2011
I was responding without reading the second post.
css rules for whitespace and word-break are what you need.
I think this is even in a nother thread already
Posts: 260
Threads: 39
Joined: Jun 2014
Thank you for moving this theme...
I do not understand what to do:
Should I edit my style.css (or the header.inc.php?) with this entry:?
Code:
#menu li { ...
white-space:nowrap;
...}
There is no #menu-like text in these files now...
And then I can use two words in the GUI box?
Using ALT + 0160 in the box is not the right way?