Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Wrapping Text in an alert box

Explorer ,
Nov 30, 2016 Nov 30, 2016

Good morning,

I created an alert for a website and am trying to figure out how to get the text to wrap automatically in Dreamweaver CC 2017 Bootstrap. Right now, the code continues on one line off the page. My code is below.

Thank you.

   <div class="container-fluid"><br />

    <div class="alert alert-danger">

   <button type="button" class="btn btn-link"><strong>INCLEMENT WEATHER POLICY: TEMPLE ISRAEL OF SOUTH MERRICK FOLLOWS THE SAME POLICY AS BELLMORE MERRICK CENTRAL HIGH SCHOOL DISTRICT. CLICK HERE FOR UPDATED INFORMATION <a href="http://www.w3.org/">http://www.bellmore-merrick.k12.ny.us/</a></strong></button></div></div><br />

2.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Nov 30, 2016 Nov 30, 2016

It would help if you wrap the Alert  inside a row and a col -- the same as other Bootstrap elements.

<div class="container-fluid">

<div class="row">

<div class="col-sm-8 center-block">

     <div class="alert alert-danger">

     YOUR ALERT BOX CONTENT GOES HERE...

     </div>

</div>

</div>

</div>

Nancy

Translate
Community Expert ,
Nov 30, 2016 Nov 30, 2016

It would help if you wrap the Alert  inside a row and a col -- the same as other Bootstrap elements.

<div class="container-fluid">

<div class="row">

<div class="col-sm-8 center-block">

     <div class="alert alert-danger">

     YOUR ALERT BOX CONTENT GOES HERE...

     </div>

</div>

</div>

</div>

Nancy

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 30, 2016 Nov 30, 2016

Nancy, if I wanted it across 12 columns and large text, would it be

<div class="col-lg-12 center-block">

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 30, 2016 Nov 30, 2016

Also in using your code above, the box is centered, however, the text still is on one line and goes off the page.

Thanks

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 30, 2016 Nov 30, 2016

The Bootstrap col- classes for mobile through desktop viewports are xs, sm, md & lg.

lg has no effect on text-size. 

For bigger text, use heading tags <h1> or <h2> or <h3>  inside your alert box.

Nancy

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 30, 2016 Nov 30, 2016

What about the second comment? I used the code and still the text goes "off the page".

    <div class="container-fluid"><br />

    <div class="row">

<div class="col-sm-12 center-block"> *I used 12 because I wanted the box and text to go across the entire width of the page.*

    <div class="alert alert-danger">

   <button type="button" class="btn btn-link"><strong>INCLEMENT WEATHER POLICY: TEMPLE ISRAEL OF SOUTH MERRICK FOLLOWS THE SAME POLICY AS BELLMORE MERRICK CENTRAL HIGH SCHOOL DISTRICT. CLICK HERE FOR UPDATED INFORMATION <a href="http://www.w3.org/">http://www.bellmore-merrick.k12.ny.us/</a></strong></button></div></div><br />

</div>

</div>

</div>

And I just saw something I have to change but that's in the <a href="...>.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 30, 2016 Nov 30, 2016
LATEST

Try this:

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>Bootstrap 3.3.6 Starter</title>

<meta name="viewport" content="width=device-width, initial-scale=1">

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<!--[if lt IE 9]>

<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>

<![endif]-->

<!--Bootstrap-->

<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">

<style>

.center-block {float:none}

</style>

</head>

<body>

<div class="container-fluid">

<div class="row">

<div class="col-sm-8 center-block">

    <div class="alert alert-danger">

    <h1>INCLEMENT WEATHER POLICY: </h1>

    <h2>Temple Israel of South Merrick follows the same policy as Bellmore Merrick Central High School District.</h2>

    <p><a class="btn btn-lg btn-danger" href="http://example.com">Updated Weather Info</a></p>

    </div>

</div>

</div>

</div>

<!--latest jQuery-->

<script src="https://code.jquery.com/jquery-1.12.2.min.js" integrity="sha256-lZFHibXzMHo3GGeehn1hudTAP3Sc0uKXBXAzHX1sjtk=" crossorigin="anonymous"></script>

<!--Bootstrap-->

<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>

</body>

</html>

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines