Jump to content

How to set a width that fits the text.


Il Domandatore

Recommended Posts

OH dear! wordpress, uses absolute path links, everyone will now know where to hack your site! were doomed, doomed i tell you.

Right! NOW that we have something to work with!

.dropdown-menu, .dropdown-menu * {
    white-space: nowrap !important;
}

Just imagine how much time and posts would have been saved

Edited by dsonesuk
Link to comment
Share on other sites

I just used there code to add white-space: property as part of styling.

.dropdown-menu, represents the actual element the class name is attached to, .dropdown-menu * represents with space the child elements and with * any child element tag type within parent class .dropdown-menu.

Just add to style.css or additional styling box that wordpress uses, ideally you would be using a child theme to separate from original theme thus avoid css being overwritten when theme updates.

Edited by dsonesuk
Link to comment
Share on other sites

Can you tell me what we're trying to do? The result doesn't work, it's probably a communication problem between the two of us, or you don't control the change of languages. The word indonesia is cut off. You can see it from the photos, or it is a solution that works on new PCs. I tried on 2 different browsers and cleared the cache.

https://postimg.cc/gallery/sj8h9c7

 

Is this normal with the nowrap?

https://postimg.cc/vgBW6mSW

Edited by Il Domandatore
Link to comment
Share on other sites

I have removed the code from your previous post.

When posting code, don't post more than around 20 lines because anything more and nobody is going to want to read all of it. You must only post the few lines of code that are related to the particular problem you are trying to solve.

Link to comment
Share on other sites

I understand, but as I have said several times; How do I know what to copy? I am a beginner and I am likely to copy 20 lines, but the problem may be outside of them. Either I copy everything, or I give you the link in private. I'm sorry, I can't help myself better than that. This will be the case for most users with little experience on this site. The others no longer ask, because they feel offended. :)

Link to comment
Share on other sites

You wanted a long menu text to not wrap and make the menu text container adjust to width of text content. That is exactly what you get! YOU CANNOT USE A FIXED WIDTH, THAT IS WHY WE REMOVED IT AND REPLACED WITH MIN-WIDTH. Your code still uses IN several places I might add, a fixed width, with overflow: hidden;  So if text extends beyond fixed width, the text will be clipped by using overflow: hidden. That is NOT! issue with my css, the issue is fixed width is still used.

FIXED WIDTH(width: 250px;) BAD.

MIN WIDTH (min-width: 250px;) GOOD!

and seriously, do you really need the font size and weight to be that humongous. 

Edited by dsonesuk
Link to comment
Share on other sites

14 hours ago, dsonesuk said:

and seriously, do you really need the font size and weight to be that humongous.

For the WCAG and my eyes, they are fine. =)

14 hours ago, dsonesuk said:

MIN WIDTH (min-width: 250px;) GOOD!

So, the value to put is 250px? I had previously asked what to put with min-width ..

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...