Solved

3 elements composition for smaller resolutions

Posted on 2010-11-30
7
357 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
  • 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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 500 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now