University Web Developers

University Web Developers

I am having the hardest time making margin settings stick in Firefox.

I have used :
div#container {
margin-left: auto;
margin-right: auto;
width: XXpx;
}

and it just doesn't seem to work.

I have also tried setting my margins to zero. I have other isssues with CSS but this is the one that is bugging me the most right now. I have been forced to do some very ugly things to get my margins to act right.

Can anyone help?!?

Views: 79

Replies to This Discussion

Are you trying to centre #container? Try making it's parent element's position either relative or absolute.
Yep, I will post the problem in the next couple of days so that we can look at it together. As you probably seen in the other reply I stuck it in a to show properly. I know - I know.
can you share a link to the page? The problem is probably with the elements around it, more than the code you have. Firefox is usually pretty easy to work with, so it should be very simple to fix.
I have torn the page into pieces. I will try to recreate the problem in the next couple of days. I did something VERY ugly to get it ready to show... are you ready.... I stuck it in a
of a table. I will bring it out of the table and show you guys - thanks for all the help
My work around is having to put both for IE and Firefox. For Firefox I put "!important" after the px and before the ; I found this solution out on the web.

padding-top: 6px;
padding-top: 8px!important;
What does the !important tell the browser?
it says hey do this nomartter what. Kathy's code cancels each other.
Can you say more what you need to do? margin-left/right: auto; is used to center the element. However you need to define a width, unless you set the display to block. By default a div is width:100%. One thing to try is to remove the div from above. Sometimes the browser thinks this says container is a child. So it is looking for
<div>
<div id="container">
</div>
</div>
hi shere hicks...what aer you trying to fix? can you ftp your file so that we could you help you to re-align whatever problems do you have?
To aggregate some of the comments already made, and to add a little bit of information I've found to be helpful in my own use of "margin: auto", here are my thoughts:
1) The div#container has to be a block-level element. If any of your CSS anywhere switched your divs to inline, inline-block or whatever, you will need to explicitly redeclare the fact that div#container should be block
2) An automatic margin only works if you define a specific width for the div. I'm assuming you have done so, since your example has "XXpx" set as the width (I'm hoping you didn't actually use "XX" in your CSS declaration).
3) It is helpful to declare "text-align: center" for the parent node of div#container, then redeclare "text-align: left" for the div#container. That is the only way I've been able to get my container div centered consistently within IE (the auto margin worked just fine for Firefox, but never worked in IE).
4) Make sure you don't have any floats that might be pushing your container in any direction. Floats that are not cleared properly will mess up the margins of your div#container.
5) Just to clarify - you do want div#container to be centered on the page, not something found inside of div#container, right?
To center a div do this:

#container {margin: 0 auto; width:xx px;}

or

#container {margin-left: 0 auto; margin-right: 0 auto; width:xx px;}
could you supply a link to the page? As others have stated it's not entirely clear what your issue is from the code you posted.

The code you have supplied will 100% give you a centered div in the browser window (again as others have said assuming you actually assigned values to xx in the width). Weirdly firefox is one of the browsers that absolutely shouldn't give you any problems on this front (unlike ie6 which benefits from the text-align 'hack' - I say hack but actually the code still validates).

Again as others have mentioned there might be some floating divs causing issues? Try adding clear:both; and see if that changes anything.

RSS

Elsewhere

Latest Activity

Jon Shaw posted a discussion

email obfuscation

Anyone using a javascript or php email obfuscation library that is effective for spam defense?See More
Jun 11
Linda Faciana commented on Lynn Zawie's group OmniUpdate
"Join us for our next webcast with Kelly Bostick from University of Arkansas who will provide some great tips on ways to ensure that all of your digital content is accessible. http://bit.ly/2zhdcIt"
Jun 6
Sara Arnold commented on Lynn Zawie's group OmniUpdate
"Creating and producing website content is just the tip of the iceberg. In our latest white paper, learn how to manage that content to help your website reach its fullest marketing and recruiting potential. http://bit.ly/30WJ0PW"
May 30
Sara Arnold commented on Lynn Zawie's group OmniUpdate
"A college or university website redesign is the most effective and cost-efficient way to attract and recruit new students. Download our ultimate guide to get started on your redesign today! http://bit.ly/30MmcSQ"
May 28
Cody Bryant is now a member of University Web Developers
May 20
Linda Faciana commented on Lynn Zawie's group OmniUpdate
"Join us for our next webcast with Rachael Frank from Gravity Switch to learn how to organize your content and messaging for a website redesign. http://bit.ly/2zhdcIt"
May 16
Sara Arnold commented on Lynn Zawie's group OmniUpdate
"Capitalize on content by creating an editorial calendar for your college or university website. Here’s how: http://bit.ly/2WCauaY"
May 9
Sara Arnold commented on Lynn Zawie's group OmniUpdate
"A soft launch of your website redesign is well worth the extra time. Find out why. http://bit.ly/2LfeigX"
May 2
Linda Faciana posted a blog post

Webcast - Website Redesign | The importance of using content inventories

Join us for our next webcast with Laura Lehman from Eastern Mennonite University to learn how to effectively use Google Sheets during a website redesign and migration! http://bit.ly/2zhdcItSee More
May 1
Sara Arnold commented on Lynn Zawie's group OmniUpdate
"What are characteristics of the best CMS for colleges and universities? Read our guide to find out: http://bit.ly/2Vt519j"
Apr 24
Linda Faciana commented on Lynn Zawie's group OmniUpdate
"Join us for our next webcast with Caroline Roberts from iFactory who will be providing tips on how to improve your SEO by finding and wisely using the keywords and phrases that matter most! http://bit.ly/2zhdcIt"
Apr 18
Sara Arnold commented on Lynn Zawie's group OmniUpdate
"If your college website is not reaching your audience, but still meets most technical and accessibility requirements, there are a number of ways to fine-tune its performance. http://bit.ly/2KO08U8"
Apr 18
Sara Arnold commented on Lynn Zawie's group OmniUpdate
"Before you click the launch button on your newly redesigned website, it pays to doublecheck the details: http://bit.ly/2D9v5vr"
Apr 11
Laurie Trow replied to Jessie Groll's discussion Thoughts on "part-time work from home" for a web developer?
"I do work from home a few days a week. Depending where you're located, this would definitely be a perk. I've found plenty of higher ed jobs, but it's not often where working from home is an option. I find this odd since the higher ed…"
Apr 4
Sara Arnold commented on Lynn Zawie's group OmniUpdate
"Take a look at these award-winning higher ed digital marketing campaigns to see what’s working for them – and what you can implement to make your school’s digital marketing campaign one of the best. http://bit.ly/2JlzLiq"
Apr 3
Sara Arnold commented on Lynn Zawie's group OmniUpdate
"Do you have a plan in place to ensure your redesigned website is a success? Read our new white paper for the steps needed to successfully launch your website so that it is effective, informative, and gets noticed. http://bit.ly/2HZt73Z"
Mar 29
Sara Arnold commented on Lynn Zawie's group OmniUpdate
"The better you pay attention to these small SEO details, the higher your website will rank in searches. http://bit.ly/2I6Yo1C"
Mar 28
Linda Faciana commented on Lynn Zawie's group OmniUpdate
"Join us for our next webcast with Brian Johnson from Tacoma Community College for tips on how to effectively communicate the website redesign process and move to a new CMS. Win over those key players and get your project started on the right…"
Mar 27
Linda Faciana commented on Lynn Zawie's group OmniUpdate
"Join us for our next webcast with Angela Cavaliere from Montgomery County Community College who will discuss how to successfully navigate a website redesign in higher ed. Learn how to get buy-in from stakeholders, organize your team, and…"
Mar 20
Linda Faciana joined Lynn Zawie's group
Thumbnail

OmniUpdate

Share your experiences using OmniUpdate CMS
Mar 20

UWEBD has been in existence for more than 10 years and is the very best email discussion list on the Internet, in any industry, on any topic

About

© 2019   Created by Mark Greenfield.   Powered by

Badges  |  Report an Issue  |  Terms of Service