You can use CSS3 media query for this. Write like this:
CSS
.wrapper { border : 2px solid #000; overflow:hidden; } .wrapper div { min-height: 200px; padding: 10px; } #one { background-color: gray; float:left; margin-right:20px; width:140px; border-right:2px solid #000; } #two { background-color: white; overflow:hidden; margin:10px; border:2px dashed #ccc; min-height:170px; } @media screen and (max-width: 400px) { #one { float: none; margin-right:0; width:auto; border:0; border-bottom:2px solid #000; } }
HTML
<div class="wrapper"> <div id="one">one</div> <div id="two">two</div> </div>
Check this for more http://jsfiddle.net/cUCvY/1/
Related Posts:
- How to make a monopoly board using css grid?
- How to horizontally center an element
- How do I vertically align text in a div?
- Hide scroll bar, but while still being able to scroll
- How to set a border for an HTML div tag
- How can I center text (horizontally and vertically) inside a div block?
- Setting table column width
- Draw Circle using css alone [duplicate]
- Why does z-index not work?
- Transparent CSS background color
- Is there any way to change input type=”date” format?
- Is element block level or inline level?
- How to center a “position: absolute” element
- How to line-break from css, without using
? - How to put img inline with text
- How to center a “position: absolute” element
- Set the table column width constant regardless of the amount of text in its cells?
- Two divs side by side – Fluid display
- CSS Display an Image Resized and Cropped
- How do I make a placeholder for a ‘select’ box?
- FontAwesome icons are not showing, Why?
- Remove border from IFrame
- CSS color vs. background-color vs. background?
- How to change text transparency in HTML/CSS?
- CSS horizontal scroll
- Getting “Failed to load resource: net::ERR_FILE_NOT_FOUND” when trying to load a background image
- CSS: background-color only inside the margin
- Stretch background image css?
- Set cellpadding and cellspacing in CSS?
- Disable Scrolling on Body
- How do I set a background-color for the width of text, not the width of the entire element, using CSS?
- CSS Background Image Not Displaying
- Changing image sizes proportionally using CSS
- How to give the background-image path in CSS?
- How to overlay image with color in CSS?
- CSS Background image not loading
- Outline radius?
- text-overflow: ellipsis not working
- How to reference nested classes with css?
- Placing border inside of div and not on its edge
- Why is there an unexplainable gap between these inline-block div elements?
- How to apply CSS to iframe?
- right align an image using CSS HTML
- CSS Background Image Not Displaying
- CSS centred header image
- How to align content of a div to the bottom
- html not linking css
- How to outline text in HTML / CSS
- How to draw a dotted line with css?
- Removing border from table cells
- How to stick text to the bottom of the page?
- How to make blinking/flashing text with CSS 3
- HTML iframe – disable scroll
- Why doesn’t height: 100% work to expand divs to the screen height?
- How can I position my div at the bottom of its container?
- Why doesn’t height: 100% work to expand divs to the screen height?
- How can I position my div at the bottom of its container?
- How do I install a custom font on an HTML site
- How to overlay one div over another div
- How to align an input tag to the center without specifying the width?
- How to get CSS to select ID that begins with a string (not in Javascript)?
- How can I embed video for discord directly from website?
- Basic CSS – how to overlay a DIV with semi-transparent DIV on top
- difference between width auto and width 100 percent
- Setting table row height
- How do I disable the resizable property of a textarea?
- How to show text on image when hovering?
- Is it possible to set the equivalent of a src attribute of an img tag in CSS?
- Place input box at the center of div
- How to display a gif fullscreen for a webpage background?
- Padding a table row
- Set cellpadding and cellspacing in CSS?
- how to do a line break in Bootstrap 3.3.7
- How to align 3 divs (left/center/right) inside another div?
- CSS content property: is it possible to insert HTML instead of Text?
- Vertical align not working on inline-block
- How to increase height of textarea using bootstrap rows and columns
- Indent List in HTML and CSS
- Align an element to bottom with flexbox
- Absolute position is not working
- Position absolute but relative to parent
- How do you specify table padding in CSS? ( table, not cell padding )
- How can I change the thickness of my
tag - Is it possible to put CSS @media rules inline?
- Make padding responsive
- Vertically align text next to an image?
- HTML not loading CSS file
- How can I center my ul li list in css?
- Is it possible to use css to shrink text to automatically fit the size of the div
- CSS !important not working
- How to best set a CSS3 transition to none?
- Why is vertical-align: middle not working on my span or div?
- ow to change the style of the title attribute inside an anchor tag?
- Flex align-items: center not centering items
- How can I align text directly beneath an image?
- jQuery find element by data attribute value
- How do I clear the content of a div using JavaScript?
- WordPress footer menu floating with height of footer
- Style reply form different than comment form
- Style the last element having a specific class [closed]