Different behavior between IE6 and Firefox for HTML Tables? - asp.net

I'm doing the first bit of web-page development I've done in years, in VS2008, using VB.net. I have a fairly simple layout, which is using several nested tables. IE6 displays the layout just fine, but Firefox for some reason shows the whole thing in a small panel at the top of the page, with a scrollbar. Can anyone suggest something basic I am likely missing?

There is a big difference in a way that IE6 renders HTML and especially tables. If you want to support it you should write explicitly all the position related styles like width, padding etc, just create a css file for table style.
The good news are that IE7 and 8 are mush closer to the standard.

Related

If I use a CSS grid layout on my webpage, and use fr will it look the same across all browsers?

So I learned about CSS grids today, and I had a question that I could not find an answer for. In my site I am creating, I used HTML tables as I did not yet know about css grids. Now that I have learned about them, I can see that grids are more useful and flexible in layout and style.
With the HTML tables, I can make it look perfect in a browser such as Google Chrome, but then I test it in FireFox and it slightly moves the divs around that I made.
If I used a grid system for a layout, and put all the content into that instead of using HTML tables, and then use the fr in css, would it keep the layout the same across web browsers? It would seem that way to me, since no matter what size of browser window or type of browser you are using, the fr keeps the grid to using 100% of the page size.
I apologize if what I am asking doesn't make too much sense. I tried to word it as best I could.
Yes. It will look the same if the browser supports grid layout.
https://caniuse.com/#search=css%20grid

How to arrange HTML5 web page elements?

I'm trying to make a sample web page to get acquainted with HTML5, and I'd like to try replicating Facebook's page layout; that is, the header that spans the entire width of the screen, a small footer at the bottom, and a three-column main body, consisting of a list of links on the left, the main content in the middle, and an optional section on the right (for ads, frames, etc.). It's neat and displays well in multiple window sizes.
So far, I've tried to accomplish this with a <header>, <footer> and a <nav> and <section> block, respectively. There's a few anomalies with the page, however. The footer (which contains a simple text block with copyright info) appears at the top-right of the page below the header when the window is maximized. On the other hand, when there isn't enough space to display everything in the window, it places the main body text below the section. In other words, it keeps moving elements around to fit the window.
Could someone please tell me how I'd achieve the look I'm going for? I've tried playing around with a few CSS attributes I read about through Google, but I'm pretty sure I don't know what I'm doing, and could really use some guidance.
Thank you!
This isn't an HTML5 question as much as it is a basic understanding of HTML and CSS. If you're going to jump in to web dev you're going to need to understand basic CSS like floating etc. I would recommend some tutorials on YouTube or NetTuts. Just play around with a few divs, move them around the page, manipulate them with CSS and it will start to come together. Then making a three column layout with fixed header and footer will seem like a piece of cake.
Floating Divs w/ CSS
I find CSS to be super hard. It is quite difficult to make a page that looks good and works on lots of different platforms and browsers. You may find it easiest to use a css framework, such as Bootstrap.
Drop that into your website, and use it to make your layout. Use the dev tools for your browser (Firebug for firefox) to examine the styles that are being applied to the various elements. Modify the styles to suit your needs.
HTML5 doesn't really give you a page layout for free. The elements you mention (header, section,etc) are used to create semantic pages, rather than to specify how they should be displayed.
Can't help much without your code. But I am sure it is because of float issue. add this CSS property to your footer clear: both
Hope it might help.
I'm not sure if you're trying to make yourself a little hack, or if you're looking for a complete library that will do all this for you, but if you're looking for the latter, I recommend Twitter Bootstrap, which is a cross-platform solution for implementing many HTML5 features, and even resorts to fallbacks for non-modern browsers. The only drawback is the requirement of jQuery in order to initialize the components that are responsive*. However, this is optional if you are not looking to implement these features. The responsive design, amazingly, does not require javascript since it is pure CSS. Hope this helps!
*Edit: meant "interactive" there, not "responsive."

Positioning of divs off in Firefox/Camino?

So, I have written out a site in HTML and CSS, and all looked fine and dandy in Safari, Chrome, OmniWeb... even Opera. Then I tested in Firefox and Camino (which I believe uses the same rendering engine as Firefox) and was unpleasantly surprised: some of the positioning of my divs was off - noticeably off - by at least 5 pixels. While that might not seem like a whole lot, I use divs to put borders around things that I would otherwise have difficulty with putting borders around (jquery image gallery, for example), so 5 pixels matters quite a bit.
My question is this - what other quirks does Firefox's rendering engine put in, and how can I get around them? Are there special properties I need to add to my CSS in order to make it behave the same for Firefox/Camino?
Thanks in advance for the help!
You should look into using a css reset, this will give you a blank slate and will for the most part normalize how browsers render the box model.
I recommend http://developer.yahoo.com/yui/reset/

JSF2 / Primefaces layout performance

Right now I'm using a full page layout and p:layoutUnits and page composition in my webapp. I have a fixed header with a menubar, and a content layoutunit, and that's all. It was easy to set up, but in IE (7) when I navigate to a new page the whole page reloads (visibly), the header is cleared then loaded, and - even more annoyingly - the menubar is displayed for a second with all the menuitems visible.
In other browsers this effect is not really visible, sadly, IE 7 is my target.
Now I'm thinking about saying goodbye to p:layoutUnits and implementing the layout with simple css magic and fixed div for the header - would it improve display in IE? Is there anything else I can do to make it faster and smoother? I'd like it to look like the header is not changing at all, only the content.
How about using iframe? Would it allow bookmarkable URLs?
I see this is an old question, but I'll throw in a new answer anyway...
PrimeFaces 3.0 <p:dataTable> supports in-table scrolling. You set a fixed height and width for the data table on your page and within that box the data table is rendered with a scrollbar. The column headers and footers stay put and you just scroll the rows. They just cleaned up some format bugs in their nightly snapshot builds that make the <p:dataTable> look great in IE 7. Might be worth a second look at PrimeFaces for those who (like me) have to support older IE browsers.
LINK: PrimeFaces 3.0 Showcase (scrollable data table)
I've finally decided to say goodbye to p:layout. I have a long table that's two or three times the size of the screen. If I put it in a scrollable layoutUnit then the scrolling is so slow that it is really annoying (tested in IE, Firefox and Chrome - equally slow). Perhaps this widget was not intended for this kind of use (displaying scrollable, long content), but now it is clear that I'll have to do a proper CSS design and stay with raw DIVs.
Nevertheless it was great for quickly putting together an application GUI that can be shown to customers.
For those struggling with layouts, follow BalusC and use simple divs/css and JSF 2.0 Templating. I started with PrimeFaces layouts and could never get it to work with complicated designs.
http://www.mkyong.com/jsf2/jsf-2-templating-with-facelets-example/

Is relative positioning the ultimate alternative for the nightmare of writing thousands of IE hacks?

I found this very interesting:
http://matthewjamestaylor.com/blog/ultimate-3-column-holy-grail-pixels.htm
He avoid using horizontal margin and paddings to avoid problems with IE. I think he "fakes" padding using relative positioning.
Have you ever done something like this?
I'm a missing a common trend against IE hacks?
Does this practice have any drawbacks?
That example is outdated.
Problems with margins and paddings like that were a problem with the broken box model of IE5. In later versions of IE you will only get that broken box model if IE is in quirks mode. That's something you should be avoiding at all cost. Use the right doctype!
The example you linked actually relies on that broken box model. He has an updated version that doesn't:
http://matthewjamestaylor.com/blog/holy-grail-no-quirks-mode.htm
But what kind of IE problems are you actually trying to address? Do you specifically want a 3-column layout like in the page you linked to? Do you want general solutions for IE layout problems? Or do you want to be able to forget about IE altogether?
The most important thing to know about when dealing with layout and IE6/7 is its hasLayout property. Read On having layout for all the details on that.
If you are specifically looking for tools that can help you build complex layouts compatible with all browsers, you could have a look at grid frameworks like YUI Grids or Blueprint. But I can't say I'm a fan of those, since they tend to result in unsemantic div soup.
If you don't mind a little (experimental) JavaScript to fix up your entire website automagically, you could give IE7.js a try. I've used this, though it definitely has its quirks and limitations, so use at your own risk.
To come back to your original question, though, relative positioning is no ultimate solution for anything, it's just one of the tools in the box. Understand it and use it when it's appropriate. See, for example, Sitepoint's CSS layout and formatting reference. And as dry as it may be, I find the CSS specification to be invaluable, especially the chapters on the visual formatting model details.

Resources