May 16, 2008

Css For Different Broswers - What methods work well to obtain consistent look

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > CSS (Cascading Style Sheets)

free web hosting

Css For Different Broswers - What methods work well to obtain consistent look

sonesay
I've been trying to use CSS to display most of my page content consistently across safari, firefox, and IE 7 but there is still number of elements that still display differently. I'm using only one style sheet and I am wondering if there is anyone whos fimilar with this problem that may be able to give me some advice. I know trying to use one style sheet is kinda difficult but I dont like the idea of having to build 1 style sheet for each broswer. It means more work that I really would rather not do.

Some major issues I'm having is:

-UL list are not displaying correctly on IE7 take a look at http://sonesay.trap17.com/application.php . This also dosent display correctly in firefox and safari sometimes. What wil happen is when it loads it displays elements on a new line instead of on the same line. There is enough width space but it still puts it in a new line.

-horizontal scrolling - I've been trying to get rid of this problem for 1024x786 resolution by reducing my page structure size yet it still has scrolling and some kind of padding that I dont want. This is noticable when page content gets long and vertical scrolling is required.

-*{padding and margins} affect things differently between broswers. in fire fox it doesnt affect buttons but in safari it does so applying an additional button{} will still not work.

- IE buttons. I dunno why the code that works for other brower buttons just submits by default and IE dosent.

Is the only way around this is to have different style sheets for different broswers? I'd really like to learn methods to code for all broswers so if I have to I will do it. Having your webpage display too differently btween broswers is not very cool.

 

 

 


Reply

bthaxor
sonesay, i think here you have used a different approach to what would be the norm.

in this situation, i would use a form. it is much easier to style, and then the submit button would work by using this code:

CODE
<input type="submit" value="Submit">


for the ul, where it puts it on a new line in ie: this is because you have actually used to <li>'s for the elements. if you want them to display on the same line, do it like so:

change this:

CODE
<ul class="app_details">
            <li class="col1">Desired Username</li>
            <li><input type="text" name="app_username" /></li>
        </ul>


to this:

CODE
<ul class="app_details">
            <li class="col1">Desired Username&nbsp;&nbsp;&nbsp;<input type="text" name="app_username" /></li>
        </ul>


(by the way, the non-breaking spaces (&nbsp;) are just to put a bit of space between the 'desired username' and the input field)

for the horizontal scrolling: what i always do with my pages is i always put in this little bit of code in my css:

CODE
* {
    margin: 0;
    padding: 0;
}


this has always worked for me.

hope i helped!

 

 

 


Reply

sonesay
The reasons for button is they look consistent across different brosewrs. input types look more different. I remeber coming across somewhere on the web but cant remember the link or information. I will get back to you on this one.

as for the UL list its been covered on http://www.trap17.com/forums/align-text-co...css-t53517.html as to why I'm using it that way . The solution given there works for all broswers exectp IE. THat method gives you a table like spacing without tables.

the margins and padding I'ved used and still smilar results. instead it makes it difficult to keep buttons consistent across brosewrs nd dosent help with the horzontal scrolling. I'ved kept my width to 942px yet it still gets horizontal scrolling. I've seen sites recommend withs of 950-960px. I'm not sure if it has anything to do with my CSS setting to align it in the middle of the page.

Reply

bthaxor
is the width of the entire page set to 100%? because if it isn't, then that could be the problem.

personally, if i were you i wouldn't care how the page appears in ie wink.gif i always base my websites on firefox, and your website seems to work perfectly in firefox: submit button and all.

oh and yeah, the submit button. so it both looks better and is viewed the same way in all browsers, i recommend using an image as your button. the image type is by default to submit the form, so you'll have no probs with that:

CODE
<input type="image" name="imagesubmit" src="image.jpg" width="55" height="22">

Reply

jlhaslip
Have a look at this link: http://www.w3schools.com/html/tryit.asp?fi...tml_form_submit

A very basic form, and there are several different ways to do the same thing, but this should work for you.

Reply

sonesay
The page is was set to 100% and the problem still existed. I applied that to body{} style. setting it lower like 942px would get rid of the center alignemnt and make it stick to the left wall.

I'm going to be using an image later for buttons but at the moment just basic default looking one will do as long as it works. I'm trying to get some experience in trying to make it work for IE 7 also. I know IE 7 sucks but I'd like to be able to say to a client one day "yeah I can make it work on lolIE7" you know.

I'll keep working and if I find a fix I'll update.

Reply

sonesay
Fixed
Button submits in IE now

CODE
<button type='submit'>Submit</submit>


Thanks for the link jlhaslip. IE will only submit a button if it has that attribute type='submit'

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Recent Queries:-
  1. what are broswers - 1256.14 hr back.
Similar Topics

Keywords : css broswers methods obtain consistent


    Looking for css, broswers, methods, work, obtain, consistent

Searching Video's for css, broswers, methods, work, obtain, consistent
advertisement



Css For Different Broswers - What methods work well to obtain consistent look



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE