Solved

How to keep images stationary when browser window is resized.

Posted on 2013-06-18
4
398 Views
Last Modified: 2013-06-26
Hello  experts, thank you for your time. In my web page I have created my navigation which consists of four images side by side, and underneath these images is a hyperlink.

It works well however if the someone resizes their browser window, then my images and links
are moved around. For example if someone drags the right side of their browser border to the left, resizing it to a very small window, the images do not stay side by side, but instead will start getting stacked above one another.

What can I do to keep my images side by side so that they will not be moved around when the
browser window is resized?




<section>
 
 <img alt="" class="leftMostNavigationImage" id="Register" src="~/Images/Step1.png" width="50" height="50" />
<img alt="" class="leftMostNavigationImage" id="Confirm" src="~/Images/Step2.png" width="50" height="50" />
<img alt="" class="leftMostNavigationImage" id="GiveContactInfo" src="~/Images/Step3.png" width="50" height="50" />
<img alt="" class="leftMostNavigationImage" id="ReviewPage" src="~/Images/Step4.png" width="50" height="50" />
 
 
<div>
 @Html.ActionLink("Register", "Register", "Home", new {  id ="RegisterLink" })
 @Html.ActionLink("Confirm", "Confirm", "Home", new {  id ="ConfirmLink" })
 @Html.ActionLink("GiveContactInfo", "GiveContactInfo", "Home", new { id ="GiveContactInfoLink" })
 @Html.ActionLink("ReviewPage", "ReviewPage", "Home", new { @class = " id ="ReviewPageLink" })
</div>

 </section>
0
Comment
Question by:brgdotnet
  • 2
4 Comments
 
LVL 17

Accepted Solution

by:
OmniUnlimited earned 150 total points
ID: 39258333
Try placing them in a containing div and fixing the width of the div like so:

<div style="width: 200;">
<img alt="" class="leftMostNavigationImage" id="Register" src="~/Images/Step1.png" width="50" height="50" />
<img alt="" class="leftMostNavigationImage" id="Confirm" src="~/Images/Step2.png" width="50" height="50" />
<img alt="" class="leftMostNavigationImage" id="GiveContactInfo" src="~/Images/Step3.png" width="50" height="50" />
<img alt="" class="leftMostNavigationImage" id="ReviewPage" src="~/Images/Step4.png" width="50" height="50" />
</div>

Open in new window

0
 
LVL 7

Assisted Solution

by:rgranlund
rgranlund earned 150 total points
ID: 39263933
in addition to what Omni recommended;
<style>
.image-link{
width:200px;
height:200px;
float:left;
}
</style>

<div class="image-link">
 <img alt="" class="leftMostNavigationImage" id="Register" src="~/Images/Step1.png" width="50" height="50" /><br />
 @Html.ActionLink("Register", "Register", "Home", new {  id ="RegisterLink" })
</div>

<div class="image-link">
<img alt="" class="leftMostNavigationImage" id="Confirm" src="~/Images/Step2.png" width="50" height="50" /><br />
 @Html.ActionLink("Confirm", "Confirm", "Home", new {  id ="ConfirmLink" })
</div>

Open in new window



etc...
0
 
LVL 2

Author Comment

by:brgdotnet
ID: 39264910
Thanks guys. Let me try it out and get back with you. Thanks so much.
0
 
LVL 2

Author Closing Comment

by:brgdotnet
ID: 39280179
Good effore
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question