I've got quite common IE8 issue with my site. IE8 renders my page differently than other browsers, which is quite annoying. I'd love if someone could help, please!
I've tried to give IE8 its own stylesheet but it doesn't seem to work.
Here's the page with the issue:
http://www.routeqr.com/toimex/tuotteet
Scroll down to picture section and you'll see that the first colum and the second column got too much space between them.
The TH-tags are also rendered wrong.
IE doesn't render margins properly there, just check the same page with Firefox or with other browser and you should see the difference.
I'd appreciate it a lot if someone could help me, I'm so lost myself.
HTML-code
<table class="tuotekuvat">
<tbody>
<tr>
<th><a name="kannakkeet">ยป Kannakkeet</a></th>
</tr>
CSS
.custom .tuotekuvat th {
float: left;
margin-top: 15px;
margin-bottom: 15px;
padding: 10px;
background-color: #333333;
}
The table is not coded correctly, you have one th (cell) with no colspans specified, and in the table itself some rows have 6 cells (columns) and some have 5. any browser may have trouble evening that up ;)
Then you are floating the single th - IE 7 and below don't understand float on a table cell/header element and will be forcing the whole of the 1st column to be as wide as the header link
If I can suggest you stick to one method or another, either floating a header outside the table, or even putting it in it's own <thead> element - and then using table-layout: fixed on the entire table so that the columns are forced to be of equal width. that should help even it up.. but mainly if you decide that the table is to have six columns (whether all of them are used or not) then for example that single th should be <th colspan="6">
get the table HTML right first and the rest should perfectly OK across browser if you then want to make it look like there's gaps between table rows and table headings you can pad the th.. but I don't really see a need for it to float outside the table structure
Remove the left and right padding:
padding: 10px;
becomes
padding: 10px 0px 10px 0px;
Hope this helps!
N.S.
In regards to empty <td> cells. It used to be that you needed at least an to have it render properly across browsers. I think that may no longer be case with current versions.
As an aside, I would recommend using tools like firefox webdeveloper and firebug . Webdeveloper has a plethora of nice features along with a link to the w3c Validator which has helped me find malformed html.
Related
Since about a year the multicolumn css3 property matured enjoying support from many browsers. Reason to finally implement it on your website for better design and readability. I thought let's push the envelope and adopt the ancient-but-ever-so-beautiful Drop Caps (=first large initial letter) into the multicolumn. However, certain screen widths break the multicolumn layout in FireFox. What am I doing wrong?
see jsfiddle DEMO
When resizing the window width, you can see the jumping/breaking of the layout in action in IE and Firefox. Below an example. Stuck on whats causing the defects in the multicolumn miss-alignments!?
Sorry for my beardy alter ego selfportrait: I forgot to shave, was staring all day at this problem with no time to tidy up. I promise you though a clean neat shaved portrait back here once this issue is solved!
Above more alignment problems in most screen widths on Internet Explorer 11. Curious Safari and Chrome show the layout faultlessly at all browser screen widths no breakage there.
#multicolumn {
column-count: 3;
-moz-column-count: 3;
-webkit-column-count: 3;
column-gap: 53px;
-moz-column-gap: 53px;
-webkit-column-gap: 53px;
column-rule-color: #EEE;
-moz-column-rule-color: #EEE;
-webkit-column-rule-color: #EEE;
column-rule-style: solid;
-moz-column-rule-style: solid;
-webkit-column-rule-style: solid;
column-rule-width: 1px;
-moz-column-rule-width: 1px;
-webkit-column-rule-width: 1px;
}
#multicolumn p:first-letter{
float:left;
font-weight:normal;
font-size:44px;
margin: 7px 1px 0px 0px;
line-height:27px;
background-color:#AEE;
}
First of all I want to say that the use of the multi column layout module is still not recommendable.
Mainly because of the missing support for the break-before , break-after, break-inside properties, with the exception of IE 10+ and the proprietary -webkit-column-break-* properties (see: CSS3 Multiple column layout).
(You also may want to take a look at my answer to this SO question: IE (11) improper handling of CSS multi-columns?)
Additionally you have to remember, that there is a so called "multi-column pseudo-algorithm", which seems to be confused by your :first-letter selector.
You can avoid this problem by using a span element with a class attribute for the drop caps instead.
But as the first letters are larger in size than the rest of the text, there arises another problem.
It may happen that a (single) line of text of the beginning of a paragraph with a drop cap may fit to the previous column, whereas the drop cap (which is about twice as high as the normal text) may not.
To avoid this unwanted behaviour you have to use another span element, which includes at least more text than that may fit into a single line (of text)!
And giving these span elements a display: inline-block; solves this problem.
Just a word about Amir5000 answer: Though my proposed solution also needs some extra span elements, it does not use "purely presentational markup" which may also produce unwanted empty lines.
But as said at the beginning, using multi-column is at least very "tricky" and very difficult to get predicted results across browsers and/ or different viewport widths.
So here is my proposed "solution": DEMO
The cause of the issue was the float:lefton the #multicolumn p:first-letterif you take that out you will see it no longer has that issue; However you don't have the same format you wanted with the first letter. So I created a JSFIDDLE where I added
#multicolumn p {
float: left;
}
and added a width for the #multicolumn container and centered it as you can see.
Hope that resolves the issue for you.
-------Update---------
So after much time trying to get it to flow as intended I was able to come up with a work around that is pretty simple, if you take a look now at the updated FIDDLE
I added an empty span in between paragraphs to clear the float and also added a media query so it looks nicer on smaller screens
This was the simplest way I could come up with to solve your issue hope that helps!!
I am not sure about the the column issue. You should make a fiddle for it so that we can help you faster. As far as the first cap issue. This is pretty tricky, what are your constraints? Can you hardcode it look right or do you have to do it dynamically?
I have posted a hardcoded solution here. It is basically just using
:before
http://jsfiddle.net/emersive/bdAWQ/1/
I have Chenges below css
p { float:left;}
#multicolumn { line-height: 20px; } /*need for IE browser*/
Demos
Ok, So I am making a travel blog through WordPress. I have made some fiddles including maps and some tables which work perfectly in the fiddle. however, now that I put it on my site - it is messing up. I think something to do with the CSS is messing it up - but I cannot find where.
The page I am having the most problem with is located here:
http://www.journeywithandrew.com/world-heritage-sites-reviews-info/
Problem (1):
The maps infobox (when an icon is clicked) is not displaying the CSS correctly.
Fiddle is here: http://jsfiddle.net/4V7en/4/
You can see what it is supposed to look like.
Problem (2):
The fusion layer I imposed is not displaying correctly when using CHROME or iOS browsers. So again, refer to the above fiddle. It displays correctly in the fiddle, and internet explorer - but not chrome. As you can see the layers is distorted in some places on my site. (like if you scroll left on the map over Australia - for example)
Problem (3):
around my check mark buttons, there seems to be a border on the table I put them in. why!?! I tried to remove this in the table (, etc) but it does not work. Not sure what CSS is causing this!
I think that is all. If someone can take a look at the site and especially using chrome you will be able to see the problems.
.caption-title-link {
text-decoration:none;
color:#41a62a;
font-size:12px;
font-family: verdana;
font-weight: bold;
}
thanks!!
1 . Add padding: 10em; to .infobox, which replaces the padding:.5em 1em at current. This should make the content sit better.
2 . Dont quite understand the issue
3 . Currently your Td is set to
border-width: 0 1px 1px 0;
Remove border-width and replace with border:none
border: none;
Thanks
Problem 1.
Table inside .infobox has a margin-bottom set. Adding .infobox table { margin-bottom: 0 } should fix it. Adjusting the td padding inside .infobox is also needed.
Em values are dependent on font-size, and in your page, you've set the font-size to 1px (vs in Fiddle, where it was 10px). Setting it back to 10px should fix the padding problems.
Problem 2. Which is fusion layer?
Problem 3. Border is coming from style.css, line 412
Throughout my website, I have many <table>s in which there is a specific column we want to have squeezed to it's minimum possible space (without having it's text wrapped). Other sibling cells share the rest of the space automatically.
I'm using the following trick and it works in all browsers except IE7-. (At this time I actually only care about IE7)
table {width:100%;}
table td.min-col {white-space:nowrap; width:1px; }
jsFiddle link: http://jsfiddle.net/vm8gc/23/
If you try this in IE7 you will notice it acts differently (not expected behavious). -- see screen capture below.
Can anyone think of a fix for IE7 to achieve this?
Attachments:
All other browsers:
IE7:
CSS 2 Version
For some reason Internet Explorer seems to ignore white-space on TDs. Best way around the problem is to use a span inside the TD.
<td><span style="white-space: nowrap;">This should not wrap</span></td>
As usual IE doing it's own thing ;)
For info on white-space support, see here:
http://www.quirksmode.org/css/whitespace.html
PRE Version
An alternative which would have better support with older browsers would be to do the following:
<td><pre>This will not wrap</pre></td>
And then have your pre element set-up to either be styled in the same way as your normal text or enable it to inherit style from it's parents (inheriting probably has less support that just specifiying the style):
td pre { font-family: inherit; font-size: inherit; color: inherit; ... }
I have been reading these forums for some time, but this is my first question :)
The question is related to styling tables. If you look at my page in Chrome, at the bottom left of my table and the bottom left <td> tag, I was able to hide the borders the using visibility:hidden; But, in Firefox, the <td> still shows these borders. I have found that Firefox doesn't like the visibility attribute.
http://allramhosting.com/new/shared-3/
.hide
{
visibility: hidden;
}
<td class="hide"> </td>
Does anyone know a way around this that will work in multiple browsers? I also tried border-color:white; in the <td> on <tfoot> and that almost works; it keeps the very bottom border line visible.
Use
.hide { border-style: none; }
or
.hide { border: none; }
on your tds or
.tableClass{ border: none;}
if your table has class tableClass.
Have you tried setting the border-width to zero?
Have you tried:
display:none
I find that works to hide things far better without side effects.
As an FYI I have found issues with proper size rendering when you start hiding "parts" of tables. Meaning that I have seen the browser (including chrome) not render the rest of the document properly or hang things off the end of the document when you hide parts of a table. If you hide the whole table it seems to figure that out fine.
I once worked around with the following trick:
Depends upon what you want to achieve in styling, but generally, setting relevant element's (color/background-color/border-color(in this case)) to 'transparent' usually works across browsers.
hope this helps someone.
Suppose I have something like this:
<table class="myTable">
<colgroup span="2" /><colgroup span="2" />
<tr><td>........</tr>
And so on...
Then on the stylesheet:
table.myTable colgroup
{
border-right: solid 5px #ffffff;
}
The point being that I want some space to separate colgroups in my table.
It's working fine in Firefox and IE8. I already read everywhere that IE7 does not implements borders for colgroup, but here is a call to your imagination and creativity, does anyone have an idea of how I could achieve a similar result in IE7, without adding a class to every cells or generating empty cell...
Here's an exemple of the result in Firefox 4 : http://imageshack.us/photo/my-images/853/capturezz.png/
The headers generated can be litterally of any form, some case are really complex. This is why the colgroup solution is interesting, since it is quite simple to calculate the needed span.
Every suggestions will be appreciated.
Don't have much experience in IE7, but this might work:
You can check if it is possible to set a background-image. And align that image (with the desired color) to the right side of the cell, making some kind of a fake border look.
In chrome setting a border on a colgroup doesn't work eighter. Setting a background-image does work.
Greetz,
XpertEase
In order to use the border property in tables, you must set the following rule. If not you wont get them
table {
border-collapse:collapse;
}
Then you will get borders working as you pretend