I have an elastic layout site. In it I am trying to use a three tiered image as a three state button. The container for this button is limited to the height of one state/tier of the button and has overflow: hidden; applied. This works fine to mask the unseen states/tiers --as long as the height for the container is set in pixels.
!!! My problem !!! As soon as I set the height of the masking container (#paper) as a percentage, to keep the layout elastic, overflow: hidden; fails expanding the container to show all the states/tiers.
I have tried setting all other parent tags with height: 100%; and/or max-height: in em's proportionate to the max-width of my wrap. No luck, no matter what I do this set-up breaks as long as #paper's height is %. Am I breaking some unspoken rule? None of my searching or research into overflow: hidden; is of any help whatsoever. -
-
HTML---
-
<div id="wrap"><img class="full" src="img/home-bckgrnd.jpg" alt="" title="">
-
-
<div id="header" class="group">
-
<div id="logo">
-
<a href="#">HUEY CROWLEY</a>
-
</div>
-
-
<ul id="nav">
-
<li id="paper"><a href="pages/paper.html"><img class="full" src="img/paper-link.jpg" alt="" title=""><span class="alt">PAPER</span></a></li>
-
<li id="paint"><a href="pages/paint.html"><span class="alt">PAINT</span></a></li>
-
<li id="junk-drawer"><a href="pages/junk-drawer.html"><span class="alt">JUNK DRAWER</span></a></li>
-
<li id="store"><a href="pages/store.html"><span class="alt">STORE</span></a></li>
-
<li id="about"><a href="pages/about.html"><span class="alt">BIO/CV</span></a></li>
-
<li id="contact"><a href="mailto:contact@hueycrowley.com"><span class="alt">CONTACT</span></a></li>
-
</ul>
-
</div> <!-- /header -->
-
-
-
CSS---
-
body {
-
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-
color: #444;
-
font-size: 62.5%; /* takes 16px (default size for ‘medium’ text in all modern browsers) down to 10px, a nice round number for quikly calculating relative parent/child font-sizes in the time-sensetive real world.
-
From now on it’s easy to think in pixels but still set sizes in terms of ems: 1em is 10px, 0.8em is 8px, 1.6em is 16px, etc. */
-
background: #000;
-
}
-
#wrap {
-
margin: 0 auto;
-
max-width: 192em; /* = 1920px; */
-
/* height: 100%; */
-
/* max-height: 152em; = 1520px; */
-
}
-
-
#header {
-
position: absolute;
-
width: 100%;
-
height: 100%;
-
top: 0;
-
}
-
#nav {
-
/* width: 100%;
-
height: 100%;
-
border: 1px solid pink; */
-
}
-
a .alt { /* text hidden from sight but safe for screen readers, only breaks if user prefs CSS=on images=off */
-
/* display: block;
-
width: 0;
-
height: 0;
-
overflow: hidden; */
-
}
-
-
/* creates sized opening for portion of 3tiered paper-link button to show through */
-
/* percentages % used to expand/contract buttons with the entire elastic layout */
-
#paper {
-
display: block;
-
/* width: 15%; result of-- 289px-this container/1920px-context of container width --#wrap-- it scales in = .15 */
-
width: 289px;
-
/* width: 20.25%; */ /* what is the context width if this is the % which displays full size ? */
-
/* height: 6%; result of-- 95px-this container/1520px-context of container height --#wrap-- it scales in = .06 */
-
height: 95px;
-
overflow: hidden;
-
border: 1px solid red;
-
}
-
/* button starts showing only top tier and returns to top tier after being activated*/
-
#paper a img, a:visited img {
-
position: relative;
-
margin: 0;
-
}
-
/* button moves up showing only middle tier */
-
#paper a:hover img {
-
/* top: -6%; result of-- 96px-this container/1520px-context of container height --#wrap-- it scales in = .06 */
-
top: -96px;
-
/* top: -101.25%; */
-
}
-
/* button moves up showing only bottom tier */
-
#paper a:active img {
-
/* top: -13%; result of-- 190px-this container/1520px-context of container height --#wrap-- it scales in = .13 */
-
top: -190px;
-
/* top: -195.25%; */
-
}
-
-
4 1703
I don't have time to look at it right now, but absolutely positioned elements are removed from the normal flow of the page. Also, when using emphasis it adapts automatically to the font. Take a look at this. I'll look at this more when I have time.
Thanks, Death
Hey thanks for the feedback.
I have been trying to make this work with a horizontal 3-image button too, thinking that if I could alleviate the vertical overflow (because the elastic layout is based widths) everything would fall into place. Not so. I'm having the same breaking of overflow: hidden; in the horizontal.
I did catch that absolute positioned div separating the container with overflow from basing its relative measurement on the em sized div#wrap. Once I switched it to relative positioning #paper was able to have its width sized relatively. In this situation #paper overflow worked ok as long as the image inside it was fixed dimensions. As soon as I added a class to the image causing it to scale to 100% of its container the overflow failed.
I'm beginning to think trying to constrain a container to a % of an elastic layout while using overflow: hidden; on it in trying to toggle a 3part image, which should also be scalable with the layout, is simply not possible.
I'm not going to be able to mess with this today - three projects plus school is taking up all of my time. Try changing the width from emphasis to pixels. If I'm not mistaken the width of the entire page is increased?
Also, the width you want should ultimately be in pixels. If I'm not mistaken, and someone please correct me if I'm wrong, emphasis is creating the width based on your font's size. In this case 62.5%, and changes depending on your browser and OS - each display fonts differently. The max-width property does not include padding, borders, or margin.
Regards, Death
Hey Death, & anyone else who should happen to come across this post,
- Totally possible and I figured it out.
Basically you have to size the sliding buttons' containers as a % of the whole ("body" is the context in this case)then, since there are 3 states, the button image has to be given a CSS rule displaying it at 300%. The reason being, the other (background) images here already scale with the layout by having a max-width of 100%. They will expand their container to its max, but since the button image container is a % of the body already, assigning the button images to the max-width 100% rule (.full) caused the image to scale DOWN, filling the % container with ALL of the button but in that lesser space. So overflow didn't even come into play. Once I figured that out I gave the button images %'s 3x that 100 and... it forced the overflow to work showing only one state of the button at a time (moving it left 1/3 by negative margins)with :hover and :active.
Breaks what might be considered a prime-directive of image-sizing for the web but in this case I think it's okay since the button file resolutions are high enough to keep them from looking like garbage.
Anyhow, it works in all major browsers. I'll go ahead and post the site address here once it is done so anyone who is REALLY interested or REALLY bored will have a chance to check out what the rambling above actually does.
-TREVOR
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Charles Blaquière |
last post by:
As part of my explorations in liquid design, I'm exploring ways to use the
overflow: hidden property -- when browser windows become too narrow, I want
(some) images to get cropped rather than have the layout break up. In some
cases, losing parts of images can be an interesting option.
http://www.hebig.org/blog/titlepic.php was the first example I found, and
it's quite nifty. His image works well when progressively cropped from the
right,...
|
by: Kai Grossjohann |
last post by:
I have a frame which is supposed to contain a list of links. The
clickable area of each link comprises a picture followed by some text.
I want the text to be cut at the right hand side when the user resizes
the frame to be "too narrow".
Right now, the source for that frame looks like this:
<table border="1" width="100%">
<tr style="background-color:#C0C0C0">
|
by: Vic |
last post by:
I've managed to achieve the effect I wanted in IE6 - although I had to
use an experession to set the vertical height of a div (I want it to
have an overflow and scroll) but I can't work out a way to duplicate
the effect in Mozilla/Firefox
the code is here:
http://www.fogcat.co.uk/example/example.html
Can anyone point me in the right direction - or at least tell me if it
is or isn't possible to get the same functionality in Firefox
|
by: Les Juby |
last post by:
I am trying to adjust the window/table size of a website
(www.worklaw.co.za) which has made use of DIV tags with its settings
embedded in an CSS file.
The client wants its width and height to adjust according to dynamic
screen size, and I have been able to adjust the width to a percentage
value which works fine. But if I try do the same with the height it
shows some very strange results squashing the field to display about 3
lines.
|
by: CB |
last post by:
Using C# in .Net 2003, DataSet.ReadXml fails when a percentage (%) sign
is in the filename followed by 2 hex characters. Seems that the %
sign is likely encoding the following 2 hex characters. So
c:\test%ab.xml fails for ReadXml since %ab is interpreted as 171 and
c:\test171.xml does not exist. There is no problem with c:\test%mn.xml
because "mn" is not a hex code. If I replace the % sign with %25
(25hex = 37dec = ascii code for %),...
| |
by: bryanrite |
last post by:
I'm trying to set up a page with a static block on the left and
variable on the right, it works as expected, but when i add an image,
or google ad, in firefox it behaves as expected, but IE drops the div.
Anyone have any ideas?
http://footstops.dev01.alkaloid.net/test.php
Any help would be greatly appreciated!
|
by: Christopher Night |
last post by:
I'm making a Javascript program that uses overflow:hidden on a containing
div to crop an image. This page (temporarily) shows an example of what I
mean:
http://www.people.fas.harvard.edu/~night/crossroads/
The relevant markup is:
<div style="overflow:hidden; width: 238px; height:47px;
border: thin yellow solid;">
|
by: esteuart |
last post by:
I need to get the right combination for a div to clip any text inside and allow vertical alignment. I only have this problem in FireFox. I have 3 divs nested within each other. The outer div has display of table, the first inner div has display of table-cell and the inner-most div has the text. The outer div has a set width and height.
So here's the problem:
Without the inner divs having a width and height set, the overflow:hidden doesn't...
|
by: zzpat |
last post by:
I have a box element that uses overflow: hidden and I want a link which
at the bottom of the element to be visible. I can't make the link visible.
Obviously I'm having problems so I was wondering if there's anything
other than overflow : hidden that will give me an absolute 'height' and
make the link visible.
Pat
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |