text flowing out of div
It's due to the fact that you have one long word without spaces. You can use the word-wrap
property to cause the text to break:
#w74 { word-wrap: break-word; }
It has fairly good browser support, too. See documentation about it here.
Text goes out of div (CSS)
As per my comment, you have set white-space: nowrap
, which tells the browser to never wrap/break the overflow into a new line. Removing that line will fix your issue.
Text goes outside containing div
Use word-wrap:break-word
div.test{
width:400px;
height:800px;
border-style: solid;
border-color: red;
margin:1px; padding:1px;
word-wrap:break-word;
}
Text going out of div
<div id="index">
<?php
$select = "SELECT * FROM products LIMIT 0,20";
$query = mysqli_query ($conn,$select);
while ($row = mysqli_fetch_array($query)){
$B = $row['Brand']; $P = $row['Product']; $D = $row['Description'];
$M = $row['Model'];$Id = $row['Id'];
echo "<div class='board' ><a href = 'redirect.php?id=$Id'>
<h2>".$B." ".$P." ".$D." ".$M."</h2></a></div>";
}
?>
</div>
CSS:
#index {
position:relative;
top:15px;
float:left;
width:482px;
height:100%;
}
.board {
background:white;
position:relative;
border-radius:15px;
border-color:#0033FF;
border-width:1px;
border-style:solid;
margin-top:29px;
height:198px;
padding-left:18px;
padding-right:0px;
margin-left:0px;
float:left;
word-wrap: break-word;
}
Overflow-y:scroll is not working, text goes out of div
In #showstarslyrics
you should be using a position: relative
, not absolute
:
#showstarslyrics{
display:block;
position:relative;
left:12%;
color:red;
}
Updated JSFiddle
Related Topics
Regex to Allow Only Certain Special Characters and Restrict Underscore
How to Restrict Past Dates in Html5 Input Type Date
Loading Screen Gets Stuck While Processing Http Request
Disable/Hide Download Button in Iframe on Default Pdf Viewer
How to Refresh Form Page After Post Request
How to Detect Browser Refresh Using Angular
Regex for Names Validation Allow Only Letters and Spaces
Allowing/Replacing Comma as Number Separator for Input Type="Number" Using Rails
Javascript How to Create One Json by Combining Two Jsons
Stringified Json Has Unwanted Double Quotes
How to Get the Name of the Current Windows User in JavaScript
How to Detect If Url Has Changed After Hash in JavaScript
Javascript Function Not Defined Error (But It Is Defined)
Regex to Replace Everything Except Numbers and a Decimal Point
How to Call Make Angular Service Synchronous
Prevent a White Space in the Beginning of a Input
How to Reference a JavaScript Object Property With a Hyphen in It