[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 365
  • Last Modified:

3 elements composition for smaller resolutions


Hi all,

The code below is a web page with 3 elements:
on the left: a soccer goal + ball image
center: a video
on the right: an image of a mobile phone

Viewing the whole thing in a resolution like mine 1440 x 900 there's no problem, all shows ok.
But when you use a less wide resolution (or you re-size the navigator window to less width), the mobile phone image goes behind the video (or the video on top of it).

What I am trying to get when in a smaller resolution (or when re-sizing to less width the navigator window) is the goal+ball image to stay where it is, and the mobile phone image to get closer to the video. But  as soon as there's no room for the 3 elements to show, it is the image of the mobile phone the one that has to get cut.

How can achieve this?? Please give me a hand with it, it's been many hours and I'm going nuts.

PD: attached myfolder.zip with the images, please rename

Thanks a lot myfolder.txt
<head> 

<style type="text/css"> 
#navigation {
}
 
#navigation ul, #navigation ul li {
	list-style: none;
	margin: 0;
	padding: 0;
}

 
#navigation ul {
	padding: 5px 15px; 
	text-align: left;
}
 
#navigation ul li {
	display: inline;

	margin-right: 0px;
	padding-top:10px;
}
 
#navigation ul li a div {
	background: url("myfolder/boton_ROLLOUT_08.png") no-repeat;

	padding: 10px 0.5em;
	
	color: #FFFFFF;
	text-decoration: none;
	font-size:12px;
}

#navigation ul li a div:hover {
	background: url("myfolder/boton_ROLLOVER_08.png") no-repeat;

	padding: 10px 0.5em;
	
	color:#FFFFFF;
	text-decoration: none;
	font-size:12px;
}     
</style>

</head> 
 
<body style="background-color:#E7E7E7;font-family: Arial, Helvetica, sans-serif;"> 

<div style="z-index:-1;position:absolute;left:0;top:30%;height:50%;width:100%;float:none">

	<div style="position:absolute;top:100px;left:0px;"><img src="myfolder/goal.jpg"></div>
		<div style="position:absolute;top:-90px;right:0px"><img src="myfolder/sonyx10_06.jpg"></div>

</div>


<div style="position:absolute;top:15%;left:20%">
 <div id="navigation" style="z-index:1;position:relative;top:-18px;left:0px"> 
	<ul> 
		<li><a href="#" id="t1" style="color:#FFFFFF;text-decoration:none;" ><div id="t1" style="float:left;width:140px;text-align:center;">tab1&nbsp;&nbsp;</div></a></li> 
		<li><a href="#" id="t2" style="color:#FFFFFF;text-decoration:none;"><div id="t2" style="float:left;width:140px;text-align:center">tab2&nbsp;</div></a></li> 
		<li><a href="#" id="t3" style="color:#FFFFFF;text-decoration:none;"><div id="t3" style="float:left;width:140px;text-align:center">tab3&nbsp;&nbsp;&nbsp;</div></a></li> 
	</ul> 

</div>

 <div id="video" style="z-index:50;text-align:left;float:left;width:726px;height:491px;padding:0px;margin-top:-20px">
 
 
			<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="710" height="480" id="index" align="middle"> 
				<param name="movie" value="http://elandroidelibre.movilgol.mobi/video.swf" /> 
				<param name="quality" value="high" /> 
				<param name="bgcolor" value="#ffffff" /> 
				<param name="play" value="true" /> 
				<param name="loop" value="true" /> 
				<param name="wmode" value="window" /> 
				<param name="scale" value="showall" /> 
				<param name="menu" value="true" /> 
				<param name="devicefont" value="false" /> 
				<param name="salign" value="" /> 
				<param name="allowScriptAccess" value="sameDomain" /> 
				<!--[if !IE]>--> 
				<object type="application/x-shockwave-flash" data="http://elandroidelibre.movilgol.mobi/video.swf" width="710" height="480"> 
					<param name="movie" value="http://elandroidelibre.movilgol.mobi/video.swf" /> 
					<param name="quality" value="high" /> 
					<param name="bgcolor" value="#ffffff" /> 
					<param name="play" value="true" /> 
					<param name="loop" value="true" /> 
					<param name="wmode" value="window" /> 
					<param name="scale" value="showall" /> 
					<param name="menu" value="true" /> 
					<param name="devicefont" value="false" /> 
					<param name="salign" value="" /> 
					<param name="allowScriptAccess" value="sameDomain" /> 
				<!--<![endif]--> 
					<a href="http://www.adobe.com/go/getflash"> 
						<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Adobe Flash Player" /> 
					</a> 
				<!--[if !IE]>--> 
				</object> 
				<!--<![endif]--> 
			</object> 
		

</div>

</div>


 
</body>

Open in new window

0
Dada44
Asked:
Dada44
  • 4
  • 3
1 Solution
 
BardobraveCommented:
Floating behaviour on block-level elements make that, on resizing to a width lesser than the minimum enough to render all blocks, the rightmost elements begin dropping to next lines.

To avoid this type of behaviour you can do several things, depending on what effect you seek and how your view is displayed.

if what you want is your two first blocks (goal and video) to float, and the third to get cropped (this will
make appear a scrollbar on your page when there isn't enough width space for the three objects) you
need to enclose the two first elements on a div and the third one on another. None of such divs will float, while inside the first one, you'll enclose your first and second element on another divs wich will float one to another.

This is usually difficult to explain, let me know if you have problems understanding it.
0
 
BardobraveCommented:
Mmmm.... I think that what I've described will make your video to jump below the goal image... you'll need to make no one of the three elements floats... but this can make your video to not render completely when window size reach too low dimensions...
0
 
Dada44Author Commented:
Hi, thanks a lot for answering.

Seems that the least resolution before all the elements go crazy is 1280x800.
Is there any way (via javascript maybe)  for the elements to stop resizing at that resolution and show the scroll bars instead?

Thanks again
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
BardobraveCommented:
Well... I supose it's possible to detect screen size through javascript and change style elements on divs upon reaching a certain resolution to avoid floating and resizing. However it's not an approach that sounds very pretty for my.

I'm not sure if there's any event attached to window resizing, but if there is any, you would be able to do what you are asking for.
0
 
Dada44Author Commented:
I'm trying adding to the body tag:
min-width:1280px;

No results, but I'm wondering if this is correctly used and if it could be a solution .. what do you think?
0
 
BardobraveCommented:
I don't think so, min-width won't allow you to force the position of elements above window resize. You should modify the width and float styles through javascript.
0
 
Dada44Author Commented:
thanks!
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now