Created
December 12, 2017 06:20
-
-
Save muthu32/9ab89ba94853bb5d35a0c8d175c88603 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Side by Side Element</title> | |
<style> | |
/*---------White space: no wrap Method---------*/ | |
.parent { | |
white-space: nowrap; | |
width: 400px; | |
} | |
.child-left { | |
background-color: orange; | |
display:inline-block; | |
} | |
.child-right { | |
background-color: yellow; | |
display:inline-block; | |
white-space: normal; | |
} | |
</style> | |
<!--- | |
/*----- Float with min width Method --------*/ | |
.parent { | |
min-width:100px; width: auto !important; width: 100px; | |
} | |
.child-left { | |
background-color: orange; | |
float: left; | |
} | |
.child-right { | |
background-color: yellow; | |
margin-left: 14px; | |
float: left; | |
} | |
----> | |
</head> | |
<body> | |
<div class="parent"> | |
<div class="child-left"> | |
child-left | |
</div> | |
<div class="child-right"> | |
child-right | |
</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment