Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

3 elements composition for smaller resolutions

Posted on 2010-11-30
7
Medium Priority
?
364 Views
Last Modified: 2012-05-10

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
Comment
Question by:Dada44
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 19

Expert Comment

by:Bardobrave
ID: 34238332
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
 
LVL 19

Expert Comment

by:Bardobrave
ID: 34238357
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
 

Author Comment

by:Dada44
ID: 34238990
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.

 
LVL 19

Expert Comment

by:Bardobrave
ID: 34239601
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
 

Author Comment

by:Dada44
ID: 34239997
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
 
LVL 19

Accepted Solution

by:
Bardobrave earned 2000 total points
ID: 34245745
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
 

Author Closing Comment

by:Dada44
ID: 34247129
thanks!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
Suggested Courses

618 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