You might have an HTML page layout with divs elements, for example, a layout with a Left Div section that holds the Body/Contents of the page and the Right Div that displays Facebook Like-box, Tags and other stuff (as this website has). You might see that the left div section may vary in size depending upon the length the contents it holds, so you might get a vertical scroll added to the right div, let's see what CSS properties to use to avoid the scrollbar.
You must create a container div that holds both the left and the right divs, and add the following CSS properties to it : height: auto !important and overflow: hidden. For the Left and the Right divs, you can set minimum height and set overflow as auto, example : min-height: 1200px and overflow: auto
File : sample.html<div class="container">
<div class="leftSection">
<p>contents of Left side</p>
</div>
<div class="rightSection">
<p>contents of Right side</p>
</div>
</div>
layout.css
.container-box {
width: 700px;
min-height: 900px;
height: auto !important;
overflow: hidden;
margin-left: auto;
margin-right: auto;
}
.rightSection {
width: 500px;
background:#ddd;
min-height: 1600px;
float: right;
overflow: auto;
margin-top: 0px;
display: inline-block;
text-align: center;
}
.leftSection {
width: 200px;
min-height: 1600px;
float: left;
background:#eee;
overflow: auto;
display: inline-block;
text-align: center;
}
- HTML5 HELLO WORLD Example
- All directional arrows codes for HTML
- Adding Sub Headings to Bootstrap Header tags
- Create HTML button that looks like a href hyperlink
- 70+ HTTP Error Codes CheatSheet
- Comprehensive 256 Ascii code table with Html Hex IBM Microsoft Key
- How to set background color in HTML page?
- Obsolete marquee element alternatives html5
- Base 64 Index, Character and Binary Table
- Get HTML table td, tr or th inner content value with id or name attribute
- Align html element at the center of page vertically and horizontally
- How to add multiple spaces between html page text
- The author stylesheet specified in tag script is too long - document contains 21759 bytes whereas the limit is 10000 bytes
- How to pretty print HTML using Java Code
- W3 HTML validator warning Unable to Determine Parse Mode
- Hyperlink in html (anchor tag) without a underline
- reCaptcha Verification expired. Check the checkbox again
- Auto Refresh Webpage after every x Second or Minute using Meta Tag?
- Chessboard with pieces using pure HTML and CSS
- Default speed of Marquee tag : SCROLLAMOUNT
- Fibonacci series from 1 to 500 table
- 9 Border to DIV Element in HTML Examples
- How to remove old 404 pages ulrs from Google crawler
- Simple Crossword Puzzle example using Pure HTML, CSS and JavaScript
- How to make a div tag clickable
- Failed to sync Gradle project Error:failed to find target android-23 - Android
- Calculate Area of Trapezoid - C-Program
- How to reset Mac Password using Terminal - MacOS
- Run Scripting Language (JavaScript, Python, Groovy, Ruby) in Java - Java
- Create a large dummy file using Mac OS X terminal command - Mac-OS-X
- How to Install glib on Mac - MacOS
- Change CKEditor Table Properties default width - CKEditor
- Step-by-Step: How to delete a git branch from local as well as remote origin - Git