Jump to content

bronzemonkey

Members
  • Posts

    433
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

bronzemonkey's Achievements

Member

Member (2/5)

0

Reputation

  1. That's a pretty limited use of sprites and it's definitely not necessary for the images to be the same dimensions. Just look at how amazon.co.uk uses a large sprite for all the main UI images - http://g-ecx.images-amazon.com/images/G/02/gno/images/orangeBlue/navPackedSprites_v13._V219533094_.png The key is simply to produce a single matrix of images that is then positioned as a background image where needed.
  2. Use a 301 redirect. Better for the user and better for any spider. Serving a 404 is a bad idea.
  3. Sounds familiar, check here - http://www.positioniseverything.net/explorer.html Can happen sometimes if you're changing the background color of some other properties on :hover. But check at PIE to narrow down the bug you're experiencing and find possible solutions.
  4. Using {opacity:1;} (because opacity is now fully supported by mozilla) won't work because it will only be 100% opacity that is inherited from the parent. If by semi transparent background you mean only semi transparent background colour, then you can use: {background:#000; background:rgba(0,0,0,0.5);} rgba is supported by all mozilla and webkit browsers. Declare a background colour before the rgba declaration to act as a fallback for any browsers that don't support rgba. In the rgba declaration the first 3 values are the rgb values and the last is the alpha value.
  5. Probably because the image is floated left. Containers are not meant to wrap floated children and IE's behaviour is not in line with the specification. You can have the container completely wrap the image by floating it left too, or adding overflow:hidden, or by using some version of the "clearfix" (google: clearfix position is everything).
  6. In addition, it's encouraged and sensible not to use "presentational" class or id values. Imagine having: <h2 class="float-left"></h2> <div class="wide no-margin"> <p class="highlight-yellow">Lorem ipsum dolor</p> </div> What happens if the paragraph needs to be restyled to be red? Or if the div no longer needs to be "wide" and needs to have margins. Or if we don't want the heading to be floated left? You might be able to restyle them without affecting other elements in different parts of the site that use the same class names...but usually it is much more difficult to do so because of the concept of using presentational class names. This links the css with the html much more closely, making it harder to use css changes alone to affect the appearance of the document. Instead there is often a need to go into the html to change class names. You can't have the css declarations for "no-margins" to contain margins, or for "wide" to end up being narrower than the default appearance, etc. But if you name based on semantics derived from the document (i.e. not with a though about how to visually present it) then you avoid both these problems. If my target has a class of "entry" or "section" then I can style it any way I want without ever having to go into the html or have confusing class names.
  7. bronzemonkey

    centering

    Make sure you have a valid DOCTYPE as the first line in your document. To center your container (or any other non-floated block element with a specified width) use: #container {margin:0 auto;}
  8. Then you'll have to post the rest of your code if you want any help, because the adjacent selector works perfectly as intended in IE7. And in the future, try to mention the specific browser you are having problems in.
  9. That's because IE6 does not support the adjacent selector. IE7 does. If you are just trying to control the space between paragraphs in a "contact" section you might be able to achieve what you are after by using margins instead. Set each <p> to have a top-margin (and no other vertical margins or padding). You will get space between the two paragraphs but without unwanted space below the final paragraph. If you are not floating the paragraphs or heading then you will find that the margin between the <h5> and the first <p> will also collapse (i.e. the space between the elements will be equal to the whichever margin is largest, they will not combine). That won't work because the first paragraph in .contact_us is not the first-child. The h5 is the first-child.
  10. Isn't that the exact same design as in a PSD/NETTUTS article? What was the license on the design in that article?
  11. Is that really your html? No DOCTYPE? iFrames?
  12. Did you set it's width to 100%
  13. IE7 doesn't need the text-align hack. That was only IE5. If you want to center a page you put {width:960px; margin:0 auto;} and that will center in all browsers from IE6 through to FF3. Probably because you were kicking IE into quirks mode by having an html comment outside of the html doc.
  14. @FilmGod: if you have no container then you are hardly ever going to find a use for clearfix, since you can just use {clear:both;} on the next element in the source. The whole point of clearfix is to clear a float container. I don't like using overflow auto/hidden because sometimes it produces scrollbars or you want to have overflow set to visible. The benefit of clearfix is that it doesn't have any other effect and it is completely robust. At the moment I just prefer to keep all the code for this behaviour together in one place. It's a crucial bit of behaviour and I find that organising it helps me better visualise what is going on in a site. That's not to say that I might not change my mind over time! But it's not very useful in that situation since you can just as easily use clear:both. Where the clearfix variants are useful is in self-clearing an element so that it completely wraps the floats it contains. Classic uses are in the navigation (where list items are floated) and on the containing element of floated columns. If you don't use clearfix then you can't apply a background to the parent and top-margins on elements below will disappear behind the floats. ------------- IE's hasLayout is not triggered on any element by default, until you apply styles that trigger it (e.g. width, height, zoom etc). When you have floated columns or nav items, they almost always have specific widths set and so they will have "layout". The trick (in terms of this desired clearing behaviour) is triggering hasLayout on their container so that it will wrap the floated children. Neither IE6 nor IE7 support the :after pseudo element but they will force an element to wrap it's floated children (incorrectly, in terms of the spec) if the element "hasLayout". IE6 can use styles like {zoom:1}; IE7 also supports {min-height:0;}. I prefer to put any IE styles in conditional stylesheets...but technically the IE7 styles can go in your normal declarations since {min-height:0;} is the default value for min-height. It has no affect at all on other browsers so you don't even need the IE7 targeting selectors. So it's down to how rigorously you want to separate the styles that are only required for IE7 from the styles that target standards compliant browsers.
  15. This looks like it is related to you having all these elements floated. The margin is just disappearing behind the float. Try floating your dividing element too.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.