html - How to add a single border for 2 divs next to each other? -


first thing, sorry if it's dumb question... have created 2 divs, 1 on left of page, other 1 on right. problem is, want put single border around 2 divs (and not 1 border each div). don't know how target 2 divs , make border surround both divs 1 element.

here html:

    <div class="left2">          <img src="images/mistake.jpg" class="img2"/>      </div>      <div class="right2">          <p>###########</p>      </div> 

and here css:

div.right2 {     width: 40%;      padding: 2% 5% 0 0;     float: right; }  div.left2 {     width: 40%;      padding: 2% 0 0 5%;     float: left;     padding-bottom: 50px; } 

thank help!!

one way put both of divs in outer div , make border around that.

html: <div id="outer"> <div id = "left"></div> <div id = "right"></div> </div>

css: #outer { border: 1px solid red; } #left { ... } #right { ... }


Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -