Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Css: width for different browsers

Posted on 2016-09-09
5
Medium Priority
?
186 Views
Last Modified: 2016-09-09
I am using width:inherit for an extjs table for FF and IE.
Chrome doesn't work well with it and works with width:auto.
How do i get it to work for all browsers?
0
Comment
Question by:renisenbb
  • 3
  • 2
5 Comments
 
LVL 8

Accepted Solution

by:
Jason earned 2000 total points
ID: 41792123
Set it to a fixed size for all browsers...

.whatever {
width: 200px;
}

You can also set width to a percentage.
width: 20%;

Edit: There are hacks for different browsers to run different code but they are not valid CSS
0
 

Author Comment

by:renisenbb
ID: 41792136
I wanted to use inherit (ff and ie) and auto for chrome. I tried using
.myclass {
-webkit-column-width: auto;
width: inherit;
}
but that didn't work.
0
 

Author Comment

by:renisenbb
ID: 41792144
I also tried :
.myclass {
-webkit-column-width: auto;
-moz-column-width: inherit;
}
That worked for chrome but not ff. It seems i have to use width instead of column-width.
0
 

Author Comment

by:renisenbb
ID: 41792167
I used one of the hacks in the link above and that worked for firefox. Thanks.
0
 
LVL 8

Expert Comment

by:Jason
ID: 41792168
np!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
Suggested Courses

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question