Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by JTeagle

  1. Yes, that is very similar to what I hit with one of the items in the original attached HTML file; I was setting margins to 0 and wondering why I was getting offsets; but I had not set left and top, so it was anybody's guess. Consider that a lesson learned. It's a relief to know I won't have to resort to a fixed content width.
  2. Agreed. (And yes, I meant margin, not border; slip of the tongue.) The problem was that I had started to think of margin-right and its counterparts as being on the *outside* of the element, thus being used to position it (because of the business of width being just the width of the content, and margin-left:auto / margin-right:auto centering horizontally); once I realised my mistake and corrected that, suddenly things worked. I did say right from the start that I accepted *I* might be the problem {:v) I still think auto could be more intelligent, but since there are other ways to achieve things it really doesn't matter. So no, CSS isn't broken, my brain was.
  3. (Funny you should use the word 'breaks' - kind of my point, isn't it?) I consider that a failing, if we're going to say it's not a bug. If you supply a margin-right value, and a fixed div width, then margin-left:auto should be perfectly capable of calculating the remaining space of the current window and pushing the div to the right side. No - that's one of the problems, as the samples showed. It does not obey margin-right when you use width:100%.
  4. If you're trying to position a div relative to the left / top edge of the window, then left: and top: would work; so should margin-left: and margin-top:. My issue is more with margin-right: on a page that wants to adapt to any browser width (rather than use a fixed content width), you can't use left: for a right-anchored div - so you should be able to use margin-right: to inset it from the right edge instead. That's what seems to be not working for fixed-position divs.
  5. I've been having some problems with getting what I wanted out of divs, and I am forced to come to the conclusion that CSS is broken. I've attached an HTML file to demonstrate the problems - you will need to edit its source HTML and follow the instructions to see the problems. I fully accept that *I* may be the problem rather than CSS, and at least all major browsers are suffering the same problem, but I really feel that CSS is at fault here and I was wondering what others thought? One challenge is to get a box to fit within the browser window (no scrolling required) with a 10 pixel border *all* around (no matter what size the browser window becomes), and another challenge is to get a fixed-width box to anchor itself to the right side of the browser window so that it is unaffected by scrolling (i.e., fixed positioning). In neither case are you allowed to use tables, and for the right-anchored box you're not allowed to use a fixed left position / margin (in other words, changing the width of the browser should keep the box anchored to the right). (This is not homework, BTW, I left school / college / university years ago! It's just what caused me to write this post.) css_issues.html
  6. According to the docs on this site it has the closing tag... can you always replace the closing tag for an element with the trailing / in the opening tag (if the element has no body text, of course)?Don't worry, I originally tried using a style sheet and a class for the colgroup as the docs suggested - that was when I first noticed it wasn't working. I resorted to the align attribute because I thought I'd done something wrong with the style sheet. And the docs say that Firefox is supported, although only span and width. So are the docs on here wrong? If so, why are they still showing the wrong info?
  7. Literally, just <colgroup align="left"></colgroup><colgroup align="right"></colgroup>To see it go wrong: 1. Go to the page for COLGROUP: http://w3schools.com/tags/tag_colgroup.asp2. Use the Try It Yourself section to get the sample up and running. Confirm that it does align as expected. 3. Now paste in a DOCTYPE declaration at the top of their sample and refresh the result. The columns revert to left aligned (table body) / centred (table headers).The colour of the third column defaults to black as well - it's completely ignoring the <colgroup> tag, apparently. But the page for COLGROUP states that there are no differences between HTML and XHTML, and indicates that it is supported for any DTD. (OK, Chrome doesn't support align, but IE should - and both should support the style attribute in the Try It Yourself sample, and so the col should be blue unless overridden by the cell contents, of course, which they're not in the sample)I realise I can use CSS on the individual cells instead, but I'm looking for clarification of the colgroup tag since I happened to try it first.
  8. Unless I'm reading it wrong, according to the page for the COLGROUP tag, it should be supported for Strict or Transitional. On its own it works as expected, but as soon as I put a DOCTYPE tag in the document, COLGROUP stops working - it has no effect. I've tried it in both IE and Chrome, so we can't blame IE for this one. If you take the Try It Yourself feature for COLGROUP, try adding a DOCTYPE declaration at the top - suddenly the columns no longer align as they should. What's happening here?
  • Create New...