Skip to content

Instantly share code, notes, and snippets.

@muthu32
Created December 12, 2017 06:20
Show Gist options
  • Save muthu32/9ab89ba94853bb5d35a0c8d175c88603 to your computer and use it in GitHub Desktop.
Save muthu32/9ab89ba94853bb5d35a0c8d175c88603 to your computer and use it in GitHub Desktop.
<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