Jump to content

how to prevent DIV from becoming bigger width-wise when URL or long line is in


jasonc

Recommended Posts

I have a few div on my page and the ones that have long lines or URL's are expanding width-wise.

 

 

<div style="width: 300px;">MyVeryLongLineThatCanAndMostLikelyContainsURLs</div>

 

 

I would like that the div keeps the same width, as the height is not a problem as the div contains other text, causing it to grow downwards anyway, and allow the line to break up with out causing any possible hyperlinks that are in the text to fail if clicked.

 

what happens is that the div grow wider to allow the long line to show inside.

  • 3 weeks later...

If you do not want the links to "break up" i would say try something like.

 

<style type="text/css">
#links {
   width: 300px;
   overflow: hidden;
}
</style>

 

basically what that will do is when something is in <div id="links"> it will make it so no matter how long the height is it keeps writing the link but will not show the text out some of 300px. I don't know if that is necessarily the direction you wish to go but you did not give much information on how you wanted it solved. Hope I could be of some help.

Thanks,

Colton Wagner

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.