
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
How to align two divs horizontally in HTML?
To align two divs horizontally in HTML, use the float CSS property with left value. You can try to run the following code to learn how to align divs horizontally −
Example
<!DOCTYPE html> <html> <head> <style> .demo div { float: left; clear: none; } </style> </head> <body> <div class="demo"> <div> <span>div1</span> <select size="5"> <option value="c1">India</option> <option value="c2">US</option> <option value="c3">UK</option> <option value="c4">Australia</option> </select> </div> <div> <span>div2</span> <select size="5"> <option value="r1">1</option> <option value="r2">2</option> <option value="r3">3</option> <option value="r4">4</option> </select> </div> </div> </body> </html>
- Related Articles
- How to place two divs next to each other in HTML?
- How to Align Column DIVs as Left-Center-Right with CSS Flex
- How can we align the JRadioButtons horizontally in Java?\n
- How to align two navbars in bootstrap?
- How to align the text horizontally in a bar plot created by using ggplot2 in R?
- How to make a div center align in HTML?
- How to create wrapper div around two other divs with jQuery?
- How to add an element horizontally in HTML page using JavaScript?
- How To Select Divs That Has A Specific HTML Content That Matches Values?
- How to center align text in table cells in HTML?
- How to wrap multiple divs in one with jQuery?
- How to join two images horizontally and vertically using OpenCV Python?
- How to align duplicates or matching values in two columns in Excel?\n
- How to horizontally center a in another ?
- How to align the bar and line in Matplotlib two Y-axes chart?

Advertisements