Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

[CSS] Text overflowing from containers

Hey

So I'm working on a site using bootstrap as a base.

I've never had problems with responsive design in the past as a result of using bootstrap however for the first time every im having issues.

Basically scaling my site down in browser works fine till I get as thin as it will possibly go (or mobile sized). When this happens, my text begins to overflow (as seen http://m.imgur.com/F6x67gq)

Now in this photo, the grey above is supposed to stretch with the text howoverit overflows. As a short term fix I'm going to hide overflows but in the long term,

What's the best practice to make divs stretch to full height of the text?

EDIT::::

the div resizes a lot up until a certain point then it just jumps and all the text jumps out the div

[Image: KR9HeVh.png?1]

[Image: dSBetae.png?4]
Well, If I understand the question, a simple HTML div tag, with default CSS properties, does the job that you want, make divs stretch to full height of the text.

Like: //jsfiddle.net/apt6csj5/

Judging the situation from an image is difficult, but probably, the problem is that you use a fixed height for the grey div.
Using a div with fixed height, basing the height on the text inside, it's not the best approach. Because the text, according to the resolution of the monitor, it's "broken/wraps" in different points, making the height different from resolution to resolution.

If you had a live demo of the problem, it would make simplest the search of the solution.
Put min-width: 200px; max-width: 100% !important; in your container's css.
Ive updated the OP but basically, the div resizes a lot up until a certain point then it just jumps and all the text jumps out the div
You're not laying your grid out properly. http://www.w3schools.com/bootstrap/boots..._basic.asp
(Aug 27, 2016 03:51 PM)Two-Ton 21 Wrote:  You're not laying your grid out properly. http://www.w3schools.com/bootstrap/boots..._basic.asp

Thi is the code.

Im sure its laid out correctly.

http://pastebin.com/LhSY3D4i
You'll be needing separate tags for the grids response when shrinking. Later when I can get on a computer, I'll try laying out an example.
(Aug 28, 2016 10:34 AM)Two-Ton 21 Wrote:  You'll be needing separate tags for the grids response when shrinking. Later when I can get on a computer, I'll try laying out an example.

Cheers mate looking forward to reading it
Here's what I came up with.
Code
Here's what I came up with.
[code]
<!doctype html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    </head>
    <body>
        <section class="video-block text-center fullsize">
            <div class="container">
                <div class="row">
                    <div class="col-lg-8 col-lg-offset-2 col-sm-12">
                        <h1>How it Works..</h1>
                        <h2 style="display: inline-block; word-wrap: break-word; width: 100%;">TextTextTextTextTextTextTextText</h2>
                    </div>
                </div>
                <div class="row" style="color: gray;">
                    <div class="col-sm-3">
                        <h2>Step One</h2>
                        <p>The first step is to register your account. Simple head over to the <a href="signup"> Signup</a> page and fill out the form to create your account.</p>
                    </div>
                    <div class="col-sm-3">
                        <h2>Step Two</h2>
                        <p>TextTextTextTextText</p>  
                    </div>
                    <div class="col-sm-6">
                        <h2>TextTextTextTextText</h2>
                        <p>TextTextTextTextTextText</p>
                        <p>TextTextTextTextTextTextTextTextText.</p>
                        <p><b>TextTextTextTextTextTextText</b></p>
                        <p>TextTextTextTextTextTextTextText</p>
                        <p><b>2. TextTextTextTextTextText</b></p>
                        <p>TextTextTextTextTextTextTextTextText</p>
                    </div>
                </div>
            </div>
        </section>
    </body>
</html>
(Aug 29, 2016 02:35 PM)Two-Ton 21 Wrote:  Here's what I came up with.
Code
Here's what I came up with.
[code]
<!doctype html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    </head>
    <body>
        <section class="video-block text-center fullsize">
            <div class="container">
                <div class="row">
                    <div class="col-lg-8 col-lg-offset-2 col-sm-12">
                        <h1>How it Works..</h1>
                        <h2 style="display: inline-block; word-wrap: break-word; width: 100%;">TextTextTextTextTextTextTextText</h2>
                    </div>
                </div>
                <div class="row" style="color: gray;">
                    <div class="col-sm-3">
                        <h2>Step One</h2>
                        <p>The first step is to register your account. Simple head over to the <a href="signup"> Signup</a> page and fill out the form to create your account.</p>
                    </div>
                    <div class="col-sm-3">
                        <h2>Step Two</h2>
                        <p>TextTextTextTextText</p>  
                    </div>
                    <div class="col-sm-6">
                        <h2>TextTextTextTextText</h2>
                        <p>TextTextTextTextTextText</p>
                        <p>TextTextTextTextTextTextTextTextText.</p>
                        <p><b>TextTextTextTextTextTextText</b></p>
                        <p>TextTextTextTextTextTextTextText</p>
                        <p><b>2. TextTextTextTextTextText</b></p>
                        <p>TextTextTextTextTextTextTextTextText</p>
                    </div>
                </div>
            </div>
        </section>
    </body>
</html>

This made no difference. Still overflowing
Oops, here's what I meant, you can use &shy--; to break text up.
Spoiler (Click to View)


Possibly Related Threads...
Thread / Author Replies Views Last Post
by randomFunPartyNov 19, 2019 04:22 AM 5 156 Nov 19, 2019 04:22 AM
Last Post: Nachfolger
by RishabhSep 7, 2019 09:47 PM 6 130 Sep 7, 2019 09:47 PM
Last Post: Rishabh
by BlufferJan 7, 2018 06:17 PM 4 162 Jan 7, 2018 06:17 PM
Last Post: Rushax