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: 27

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

Catherine Cherry replied to Daniel Bashaw's discussion What tech do you use for remote presentations?
"We use Adobe Connect for all of our mixed media webinars and presentations, whether they are run purely online or with a live audience as well. We love it, it's an amazing product and so worth our investment (we went with the enterprise license…"
4 hours ago
Profile IconAndrew Harris, Lindsey S. Wilkerson, Melissa Martin-Greene and 32 more joined University Web Developers
5 hours ago
Daniel Bashaw replied to Daniel Bashaw's discussion What tech do you use for remote presentations?
"I thought I'd follow up on my own post here, and share the solution we came up with: After playing a bit with Google Hangouts and Skype screen-sharing, we decided on an alternative approach: A presentation 'sandwich'... We'll…"
9 hours ago
Nic Winn replied to Matt Bosma's discussion Check out our new website, provide some quick feedback
"Your use of color is great. Especially on this page https://www3.tech.purdue.edu/degrees. I'm curious to know the logic of the background color for the degree programs. At first I assumed it was alpha but that didn't hold. Couple of…"
13 hours ago
Mike Vysocka posted a blog post

Powering 160+ domains with a single WordPress install (no plugins, and 1 theme).

http://go.ncsu.edu/wordpress Mike VysockaWeb Developer & Business Solutions ArchitectNorth Carolina State University - Raleigh, NC@thewebvySee More
14 hours ago
Debbie posted a blog post

Job well done Terry!

Sad to hear that the University of Michigan list is closing today. Terry Calhoun has done a wonderful job over the many years I've been on the list and it has been an excellent resource for my team.Thank you Terry and University of Michigan! And thank you for a job well done.See More
15 hours ago
Annette Spearman replied to Chris Lewinski's discussion Success metrics for web CMS implementation?
"Hi Daniel, The measurement of success is based on the reason for the change of CMS in the first place. Is the CMS upgrade part of an overall redesign and updated information architecture? Or is it a stand alone project? Are you moving from having no…"
Thursday
Daniel Bashaw posted a discussion

What tech do you use for remote presentations?

A former intern and I will be doing a conference session on 'Getting Started in Chinese Social Media' at #PSEWEB in Vancouver on June 25th. We'll be presenting from London Ontario, using a mix of slides, video, and screen-shared web browsing. We plan to use a single connection with a mic and webcam here in London, and another laptop with a projector and audio in the conference room in Vancouver.Technologies we've considered using are Google Hangouts, Skype, and OBS (…See More
Thursday
Kathy Jensen replied to Matt Bosma's discussion Check out our new website, provide some quick feedback
"Hi Matt, I just took a quick look - from a prospective student point of view. The first thing I want to know about is your degrees, so I hit that link under "Prospective students." I saw that the first degree listed says it's…"
Wednesday
Kathy Jensen posted a discussion

Content: Header and Footer

Greetings,We are in redesign mode for several sites, including the University of Minnesota home site. We've determined this would be a good time reevaluate the standard web header and footer that we require for all UofM websites. The issue is how.We've made decisions in the past about what links go in the header and footer based on what kinds of items are globally useful. Simple enough. But...we will also be launching a new…See More
Wednesday
Daniel Bashaw replied to Chris Lewinski's discussion Success metrics for web CMS implementation?
"Hi Annette -- any chance you could share a version of your questions here? It might be very helpful to those of us contemplating CMS changes and upgrades. Thanks!"
Wednesday
Jason Slater replied to Jason Slater's discussion Video aggregator/portal solutions?
"Haven't had a chance to dig into dunked yet.  Waiting till things die down after Commencement.  Looks promising from the marketing materials but requires a real account to fully understand it.  Thanks for the tip."
Jun 11
Chris Lewinski replied to Chris Lewinski's discussion Success metrics for web CMS implementation?
"Thanks, Annette!"
Jun 11
Annette Spearman replied to Chris Lewinski's discussion Success metrics for web CMS implementation?
"Hi Chris, I have some questions to consider when determining the best way to measure success of a new cms. I'll send you an email that may help. Annette"
Jun 11
Profile IconJames Kempster, David Rabinowitz, Jonathan Kent and 2 more joined University Web Developers
Jun 11
Derek Tonn posted a discussion

Question about video files (breaking into individual image frames, then reassembling)

I am wondering what techniques or programs out there I could use to complete the following steps:1. Take video files (.mpg, .mov, .wmv, etc.) and break them apart into their individual frames.  I assume .jpg files with little/no lossy compression being applied (98-100% quality).2. Take said individuals frames/.jpgs and "recompile" them back into .mpg, .mov, .wmv, etc.My thought/theory is that if I can get each frame into an individual image, then optimize the HECK out of the image without…See More
Jun 11
Sara Michel commented on Lynn Zawie's group OmniUpdate
"Congrats to Webster University on going live with their new online course catalog! Great job team!"
Jun 10
Chris Lewinski posted a discussion

Success metrics for web CMS implementation?

We are in the initial stages of project planning for a web CMS implementation in FY2014.  As we begin to develop our project planning documentation, we are somewhat struggling to come up with meaningful, measurable metrics for determining success of our project.  So far, we are considering measuring: 1) the percentage of trained content managers that are "actively" using the system once implemented, and 2) the percentage of trained content managers who are "satisfied" or "very satisfied" with…See More
Jun 10
Derek Tonn replied to Matt Bosma's discussion Check out our new website, provide some quick feedback
"Hi Matt! I took a look at that site tonight.  Here's a couple thoughts: 1. Bottom nav is very text heavy.  Lots and lots of words.  I understand why you need all those links/options...but it just is in such stark contrast with…"
Jun 9
Kimbel Jeffers replied to Kimbel Jeffers's discussion Office Reservation software
"I've found a few options from these software companies called Asure and Active Data."
Jun 8

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

© 2013   Created by Mark Greenfield.

Badges  |  Report an Issue  |  Terms of Service