Sunday, September 21, 2014

Increase div width according to the text inside it.

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title></title>
  <style type="text/css">
  .messages {
     display: table;
     max-width:50%;
     min-width:150px;
     background: #ffeec0;
     padding:2px;
     margin:3px;
     -webkit-border-radius: 2px;
     border-radius: 2px;
     border:1px solid #ffdd7c;
}
  </style>
</head>
<body>
<div class="messages">
  MaHiiiiiiiiiiiiiiiiiiiiiiiiiiii
</div>
  MaHiiiiiiiiii Mahiii mabghvdsjbvfcnxb jhdsvdbvjhsd dsksjgvjhsvsnccsvsdvsv
  acsddvsvsbdbdfbgfnf mahiiiiiiii MaHiiiiiiiiii mahiiiiiiiiiiiii
</body>
</html>


Output :)


No comments:

Post a Comment