asp.net user control on new line

I have an asp.net website that uses user controls. What i want to do is control them with css code. When the screen is full screen have them all on one line but for smaller sceens have them each on one line. can this be done and how

Below is the code:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="top.ascx.cs" Inherits="UserControl_top" %>
<%@ Register Src="~/UserControl/searchBox.ascx" TagPrefix="uc1" TagName="searchBox" %>

<%@ Register src="UserInfo.ascx" tagname="UserInfo" tagprefix="uc2" %>
<%@ Register Src="~/UserControl/checkoutcart.ascx" TagPrefix="uc1" TagName="checkoutcart" %>


<div class="top">
    <div id="SearchBox">
        <uc1:searchBox runat="server" ID="searchBox" />
    </div>
    <br />
    <br />
    <div id="UserInfo">
        <uc2:UserInfo ID="UserInfo1" runat="server"   />
    </div>
    <br />
    <br />
    <div id="checkOut">
        <uc1:checkoutcart runat="server" ID="checkoutcart" />    
    </div>
</div>
Ron RenningerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

louisfrCommented:
You can use css to control how the div and br are displayed.
With the following style in your html page, the divs are side by side when the browser's width is more than 800 pixels, and stacked one under the other when less.
  <style>
	@media (min-width: 800px) {
		div.top div {
			display: inline
		}
		div.top br {
			display: none
		}
	}
  </style>

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ron RenningerAuthor Commented:
the line breaks do not do what i want them to do below is the code

<div class="top">
     <div id="SearchBox">
         <uc1:searchBox runat="server" ID="searchBox" />
         <br />
     <br />
     </div>
     
     <div id="UserInfo">
         <uc2:UserInfo ID="UserInfo1" runat="server"   />
         <br />
     <br />
     </div>
     
     <div id="checkOut" style="padding-top:15px;">
         <uc1:checkoutcart runat="server" ID="checkoutcart" />    
     </div>
 </div>
each user control shold be on a new line
this is the code for when the screen is a moble device

@media screen and (max-width: 400px){
    .bundles{
        float: left;
        margin: 20px 0 0 0;
        width: 90%;
       
    }

     .videoShow
            {
                visibility:hidden;
                display:none;
            }
      div.top div
    {
                  
      }
      div.top br
    {
                  display: inline;
      }
   
}

this is the code for bigger screens
 no line breaks

div.top br {
                  display: none
            }
louisfrCommented:
For bigger screens, you have to set the display property of the divs to "inline". Default is "block" which puts them in their own line.
div.top div {
    display: inline
}

Open in new window

Also, I think that setting the display property of the br to "inline" does nothing. Either they are displayed and you have a line-break or they are not displayed at all.
louisfrCommented:
I tested the answer before giving it. It works.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.