none
Div Centering Question RRS feed

  • Question

  • Im attempting to create a template (dwt file) and I need some feedback.  I'm a longtime FrontPage user and I'm trying to unlearn some things so bare with me.  The template is going to have a header which will contain a logo, a body which will contain content and a footer with general info, so I created a header, body and footer div.  The wrapper div is about 850 pixels wide and the body div is 750 pixels wide. 

    How do I center the body div?


    Tony
    Monday, April 26, 2010 12:48 PM

All replies

    • Proposed as answer by Veign Monday, April 26, 2010 6:32 PM
    Monday, April 26, 2010 12:50 PM
  • Thanks for the information, but it lead to another question.  When I created the body div I did it by creating a style in EW and I'm finding it confusing to understand when to go right to editing code and when to rely on EW to create the code for me.

    In other words, because you are comfortable with CSS and I'm not, my inclination is to rely on EW to do certain things for me.  Having stated that, should I be asking questions with the caveat that I need to know how to do it within the boundaries of EW?

    Relying on EW, can't I just edit the style for that div?


    Tony
    Monday, April 26, 2010 1:42 PM
  •  You know how we keep  telling you to use the resources is the BEFORE POSTING sticky, well part 3 of the basic website tutorial shows you exactly how to constrain the width of a page and center it in a browser using the css tools in EW but then you didn't listen when it was recommended.


    MS MVP Expression Tutorials & Help http://by-expression.com
    • Edited by Cheryl D Wise Monday, April 26, 2010 2:52 PM fixed tablet gremlins
    Monday, April 26, 2010 2:51 PM
  •  You know how we keep  telling you to use the resources is the BEFORE POSTING sticky, well part 3 of the basic website tutorial shows you exactly how to constrain the width of a page and center it in a browser using the css tools in EW but then you didn't listen when it was recommended.


    MS MVP Expression Tutorials & Help http://by-expression.com

    Hi Cheryl,

    I've looked at most of tutorials numerous times and I still don't understand it.  Honestly, I've learned so much over the last few days that what might be simple and straight forward to you is overwhelming me at this moment in time because I've learned so much.  I might have seen the exact answer, but I don't remember it.  That's why I'm asking.

    Please stop suggesting that I look at the videos and resources and assume that I've attempted everything in my power to satisfy your need to remind me of that.

    I honestly appreciate your efforts, but we need to get away from this matter and move on.  Thanks.

     


    Tony
    Monday, April 26, 2010 4:21 PM
  • Tony, I am going to suggest another thing:  there is a search function in this forum.  While I'd be the last to suggest it works brilliantly, it will bring up topics that have been asked and answered many times.  Give it a try (with some search term variations) first.

    For example, type in "centering div", and you'll get the answer.

    Monday, April 26, 2010 5:40 PM
  • Thanks for the information, but it lead to another question.  When I created the body div I did it by creating a style in EW and I'm finding it confusing to understand when to go right to editing code and when to rely on EW to create the code for me.

    In other words, because you are comfortable with CSS and I'm not, my inclination is to rely on EW to do certain things for me.  Having stated that, should I be asking questions with the caveat that I need to know how to do it within the boundaries of EW?

    Relying on EW, can't I just edit the style for that div?


    Tony

    I turns out that until you understand css and html well enough to write it without a WYSIWYG editor, relying exclusively on such a tool will likely get you in a lot of trouble. After a novice drags boxes around a page for a while they are left with a mess that no one can fix.

    On the matter of how to center content on a page using CSS, that subject gets a new thread launched here once a week it seems and the experts apparently are getting grumpy about dealing with it.

    http://www.maxdesign.com.au/articles/center/

    Monday, April 26, 2010 6:01 PM
  • On the matter of how to center content on a page using CSS, that subject gets a new thread launched here once a week it seems and the experts apparently are getting grumpy about dealing with it.


    Not sure why you make that statement.  First post, 2 mins after the original question, has the answer. 

    --
    Chris Hanscom - Microsoft MVP
    On Facebook | On Twitter | Resource Center | Veign's Blog | Web Development Help

    Get a Complete Website Analysis by Veign
    Monday, April 26, 2010 6:32 PM
  • Asking questions within the boundries of EW includes code since EW has code view.  If you're looking for answers that user wizards and dialog boxes only then good luck getting many answers.  You want people to help you and you want to set the rules at which the answers have to follow because you don't want to spend the time learning...


    --
    Chris Hanscom - Microsoft MVP
    On Facebook | On Twitter | Resource Center | Veign's Blog | Web Development Help

    Get a Complete Website Analysis by Veign
    Monday, April 26, 2010 6:39 PM
  • Hi Max,

    This is my dilemma, this is an EW forum and many of the responses I get are about CSS.  Although I know CSS is a big part of the equation, my questions really pertain to how EW works.  There are many settings when you create a style for a div when something doesn't work right I try to retrace my steps and figure out my mistake.

    I know many of the things can be fixed by looking at the css code, but I'm still trying to figure it out from an EW point of view.

    Regarding the experts, I agree.  But this is a forum, a place for discussion, and I can assure you its rare when I ask a question in which I already know the answer.


    Tony
    Monday, April 26, 2010 6:44 PM
  • Tony, I am going to suggest another thing:  there is a search function in this forum.  While I'd be the last to suggest it works brilliantly, it will bring up topics that have been asked and answered many times.  Give it a try (with some search term variations) first.

    For example, type in "centering div", and you'll get the answer.


    I do use that feature and when I type a question it also suggests previous discussions.  I assure you, I've looked.

    Tony
    Monday, April 26, 2010 6:46 PM
  • Not sure why you make that statement.  First post, 2 mins after the original question, has the answer. 

         You're right Chris, your early answer was responsive to the question. Nevertheless, that question gets asked more than most here and it does prompt some curt replies.
    Monday, April 26, 2010 6:50 PM
  • Web design is not about pushing buttons, pulling levers and praying it all works correctly.  Its about understanding the underlying technologies and applying this knowledge, through tools, to a website.  Without the underlying knowledge you will go nowhere and no answer will truly make sense.

    --
    Chris Hanscom - Microsoft MVP
    On Facebook | On Twitter | Resource Center | Veign's Blog | Web Development Help

    Get a Complete Website Analysis by Veign
    Monday, April 26, 2010 6:55 PM
  • Ok folks,

    There are three people that are consistently giving me grief for the questions I'm asking.  Please, if you don't like my questions ignore them.  If you don't like my replies, please ignore them.  If you feel my questions do not fit your criteria for an answer, please ignore them.

    For the rest of you, I can assure you that I've searched this forum and other resources for the answer and I've also watched video tutorials trying to learn EW.  At this point in time, I'm trying to learn things from an EW point of view allowing the software to aid me in my css shortcomings. I promise you I will do my best to ask compelling questions.

    And for everyone kind enough to help, it is truly appreciated.

     


    Tony
    Monday, April 26, 2010 7:03 PM
  • Time,

    The topic comes up so frequently that Chris and I have both created separate pages to point to http://by-expression.com/blogs/by-expression/archive/2010/04/06/centering-a-web-page.aspx is mine since Chris already posted his.

    As I pointed out part 3 of the Basic Website tutorial is a video step by step of how to fix a width for a page and center it in every even semi-standards supporting browser (aka IE 6 and later, any version of Firefox, Safari or Chrome and I think Opera 5 and later). So both Chris's response and mine were directly answering the question.

    As for Kathy's suggestion to search the forum, doing so with "center page" gets 537 posts (http://social.expression.microsoft.com/Search/en-US/?query=center%20page&rq=meta:Search.MSForums.ForumID(9349f597-54d9-49d4-b253-64b0d111d303)+site:microsoft.com&rn=Expression+Web+and+SuperPreview+Forum) and while not all are really responsive to the quest the first three thread are directly on target.

    Yes, some folks are getting a little testy with folks who think you can do things without ever understanding why using "buttons" in EW. Any website created by clicking on buttons will break sooner or later and if you don't know what the app is doing and why you won't be able to fix it. Instead those folks come and ask that their problems be solved by others without learning anything themselves. If someone wants a website w/o learning the basics then they should hire someone who does.


    MS MVP Expression Tutorials & Help http://by-expression.com
    Monday, April 26, 2010 7:54 PM
  • Relying on EW, can't I just edit the style for that div?

    Yes.
    Will
    Baltimore, MD USA - www.fastie.com
    Monday, April 26, 2010 8:28 PM
  • So now that is settled, what kind of layout is better, CSS/DIV, Tables or Layers?
    Monday, April 26, 2010 9:58 PM
  • So now that is settled, what kind of layout is better, CSS/DIV, Tables or Layers?

    Troublemaker.
    Will
    Baltimore, MD USA - www.fastie.com
    Monday, April 26, 2010 10:03 PM
  • Actually, I think that is a great question.

    1.) Are tables really terrible?  If so, why are they part of EW?

    2.) What I've learned in the last few days is that layers and divs are differentiated by positioning...I think.

    Feedback would be appreciated.


    Tony
    Monday, April 26, 2010 11:57 PM
  • Search the forum for many discussions.  This topic has been discussed ad-nauseum. No sense re-hashing the same old stuff.
    --
    Chris Hanscom - Microsoft MVP
    On Facebook | On Twitter | Resource Center | Veign's Blog | Web Development Help

    Get a Complete Website Analysis by Veign
    Tuesday, April 27, 2010 12:04 AM
  • You can build fairly good functional pages using mainly the tools and letting EW write the code. I would not argue with those that say this is not the best practice or that those will be the cleanest coded pages but in fact the concept behind those tools and wizards is to permit non-coders to build sites and the Microsoft literature and a great many reviewers say just that. Again- I am not defending the practice but the product was created with non-code capable users in mind in part. Of course many might consider such a capabillity the saving grace of Frontpage in its day. In my own opinion- EW will in future versions enhance its support for non-coder types as that is the best way to attract the largest market.

    Regarding CSS vs tables. While there is no question tables are out in most cases there are a lot of legacy sites and yes- even new ones still using tables. Former Frontpagers may be able to ease into CSS templates made by pro's until they become proficient. Frankly- I really started understanding CSS much better after looking at and filling templates with content. The templates that come with EW are a great start and you can make some test pages with them to learn. You will see its almost as easy as tables when using a ready made template.

    The best way to understand divs and thier behaviors is to make a bunch of them on test pages and then use the tools to change them. All the while keep looking at the code generated. Go ahead and drag stuf around and mix it up. Then look at the code and What Chris, Cheryl, and others have said will be apparant and you will want to learn more just so you can untangle it when things do go wrong.

    I do not disagree with the other comments here but also think it is valid to use the code generating tools ( with ample checking and validating with other tools) and expect to make functional pages while you gradually learn all the while with the notion that as you learn- and as part of the learning process- you can and will go back to those pages in the future.

    On a side note a co-worker and former Frontpager is almost done with a 15 page plus site and still does not know anything about code but used EW tools exclusivly. It is not up yet but it previews well and validates with EW's checker so far. I will be looking at this site in detail to see how and if it fails because of EW code generation. We are most interested to see how EW breaks a site with its code output.

     

    Tuesday, April 27, 2010 1:11 AM
  • Speaking of "ad-nauseum".
    Tuesday, April 27, 2010 2:29 AM
  • I thought "ad-nauseum" was too many commercials during Star Trek?

    Whats with the volume of commercials now?

    Did you hear the one about the Div that tried to cross the page?

    Tuesday, April 27, 2010 7:35 AM
  • 1. No, if they are used as intended ie. for tabular data NOT layout.
    2. A layer is an absolutely positioned div.
     
    Regards Jens Peter Karlsen.
     
    On Mon, 26 Apr 2010 23:57:26 +0000, Tony Boston wrote:
     
    >
    >
    >Actually, I think that is a great question.
    >
    >1.) Are tables really terrible? If so, why are they part of EW?
    >
    >2.) What I've learned in the last few days is that layers and divs are differentiated by positioning...I think.
    >
    >Feedback would be appreciated.
    >Tony
     

    Regards Jens Peter Karlsen.
    Tuesday, April 27, 2010 10:59 AM
  • Search the forum for many discussions.  This topic has been discussed ad-nauseum. No sense re-hashing the same old stuff.

    According to Websters the definition of forum is "a public meeting place for open discussion." 

    I've opened a discussion by asking a question(s) and people have been kind enough to reply and I truly appreciate that.  If you feel this is repetitive please ignore it.  If I've beaten a dead horse, that is my option.  The beauty of this environment is that you can totally ignore my questions and help others that ask better questions.

    As a newbie to this forum, I've learned I can search for things, watch videos and visit other resources to learn about many things related to CSS, EW, web design and more.  But with all due respect, some members have made me feel unwelcome and I'd urge them to give newbies such as me a little time to adjust to the environment and understand that learning about the software is difficult enough, without the constant reminders and less than positive reinforcement.

    As I've stated before, I fully appreciate when people take the time to answer questions and help me out and that hasn't changed.

     

     

     


    Tony
    Tuesday, April 27, 2010 12:04 PM
  • Just ignoring this type of question, as you suggest, doesn't help
    anyone whereas pointing out that there is a search function not only
    helps you but also others that see the answer.
    If you can get an answer to your question in a couple of minutes
    searching, isn't that better than waiting sometimes several hours for
    an answer or as you suggested just being ignored?
     
    Regards Jens Peter Karlsen.
     
    On Tue, 27 Apr 2010 12:04:46 +0000, Tony Boston wrote:
     
    >Search the forum for many discussions. This topic has been discussed ad-nauseum. No sense re-hashing the same old stuff.
    >
    >
    >According to Websters the definition of forum is "a public meeting place for open discussion."
    >
    >I've opened a discussion by asking a question(s) and people have been kind enough to reply and I truly appreciate that. If you feel this is repetitive please ignore it. If I've beaten a dead horse, that is my option. The beauty of this environment is that you can totally ignore my questions and help others that ask better questions.
    >
    >As a newbie to this forum, I've learned I can search for things, watch videos and visit other resources to learn about many things related to CSS, EW, web design and more. But with all due respect, some members have made me feel unwelcome and I'd urge them to give newbies such as me a little time to adjust to the environment and understand that learning about the software is difficult enough, without the constant reminders and less than positive reinforcement.
    >
    >As I've stated before, I fully appreciate when people take the time to answer questions and help me out and that hasn't changed.
    >
    >
    >
    >
    >
    >
    >Tony
     

    Regards Jens Peter Karlsen.
    Wednesday, April 28, 2010 1:07 PM
  • Search the forum for many discussions.  This topic has been discussed ad-nauseum. No sense re-hashing the same old stuff.

    According to Websters the definition of forum is "a public meeting place for open discussion." 

    I've opened a discussion by asking a question(s) and people have been kind enough to reply and I truly appreciate that.  If you feel this is repetitive please ignore it.  If I've beaten a dead horse, that is my option.  The beauty of this environment is that you can totally ignore my questions and help others that ask better questions.

    As I've stated before, I fully appreciate when people take the time to answer questions and help me out and that hasn't changed.


    Tony
    Take your own advice Tony. If you don't like what someone replys, then just ignore it. The debate about what should or should not appear here makes for some poor reading.
    Wednesday, April 28, 2010 1:49 PM
  • Search the forum for many discussions.  This topic has been discussed ad-nauseum. No sense re-hashing the same old stuff.

    According to Websters the definition of forum is "a public meeting place for open discussion." 

    I've opened a discussion by asking a question(s) and people have been kind enough to reply and I truly appreciate that.  If you feel this is repetitive please ignore it.  If I've beaten a dead horse, that is my option.  The beauty of this environment is that you can totally ignore my questions and help others that ask better questions.

    As I've stated before, I fully appreciate when people take the time to answer questions and help me out and that hasn't changed.


    Tony
    Take your own advice Tony. If you don't like what someone replys, then just ignore it. The debate about what should or should not appear here makes for some poor reading.

    TB makes a very salient point, Tony. And since you're so fond of definitions, Tony, how about one that actually refers to an online forum of the kind you are now participating in. From the Wikipedia article on online forums, with respect to the nature of online forums:

    "People participating in an Internet forum may cultivate social bonds and interest groups for a topic made from the discussions."

    In other words, as pointed out several times in previous posts, this is a social forum, with a set of expectations and a system of etiquette like any other social grouping. Germane to this issue is this amplification:

    "Most forums have a list of rules detailing the wishes, aim and guidelines of the forums creators. There is usually also a FAQ section contain basic information for new members and people not yet familiar with the use and principles of a forum (generally tailored for specific forum software)."

    Although this forum does have a set of rules, further up in the top matter, determined by the creators, MS in this sense, the FAQs and other resources contained in the BEFORE POSTING sticky were compiled by Bill Pearson, with suggestions and additions from all of the other regular contributors here, and has received the imprimatur of the MS moderators by being designated a sticky thread to be maintained at the top of the thread list.

    Those FAQs embody the expectations and etiquette of the social group in which you have chosen to participate. And whether you have thought about it or not, repeatedly asking questions that could be quickly and easily answered by yourself, if you troubled yourself to do so, does have a negative consequence to the group as a whole, both the long-time regular contributors and new users like yourself.

    For example, at one point early in your posting "career" here you had six posts on the front page of the thread list. Two pairs of them asked essentially the same question in different form with different wording. Why is that a problem? Because that first page of the thread list is precious territory. It is where a question posted is most likely to be seen and to receive an answer.

    Many people, myself included, seldom go past the first page when visiting the forum. By repeatedly posting questions to which the answer is readily available, or which you should know anyway if you had taken the recommended advice to prepare yourself with the resources listed in the FAQs, you push others' queries right off the first page into the netherworld where they may never even be seen, much less answered. Every one of those questions are at least as deserving of an answer as any of yours, and in most cases much more deserving, given your predilection for asking pointless questions to which the answers are readily available if you will only look for them.

    There's even a thread here where you illustrated that point more eloquently than anyone else possibly could have. In this thread http://social.expression.microsoft.com/Forums/en-US/web/thread/4c8d9d8f-db2c-494f-a2d3-f4589f73e32f you asked a question and then, within minutes, answered it yourself. What was required to come up with the answer? Simply exploring the EW user interface, or possibly consulting the Help file, either or both of which should have been your first approach to resolving the question.

    And that is the point. When you have a question, instead of looking for the answer yourself, and instead of preparing yourself by working the many tutorials and other resources specified in the sticky post, you come running here to ask the forum to be your personal Help system. And then you're surprised when the many people who have had a part in compiling those resources, for a reason, chide you for taking up unnecessary forum space with questions you should answer yourself.

    You have said that you have worked through Cheryl's "Build a Basic Web Site" video tutorial, and I'll tell you straight up, I don't believe you. I have viewed and worked through that tutorial and you could not possibly have done so and still need to ask some of the questions you are asking here, unless you have the IQ of a carrot.

    Although I came to Expression Web with well over a decade of experience with HTML and CSS, and Dreamweaver, I had no clue about EW itself. I saw that tutorial as an excellent way to familiarize myself with the EW user interface, and it was. By the time I was done, I was also impressed by the amount of training using standards-compliant markup and CSS in page development that the tutorial contained, and wrote an extensive review of the tutorial which, AFAIK, is still posted on that page.

    You clearly and expressly have stated that you do not have that background of experience and knowledge, pleading repeatedly that, "Remember, I come from a FrontPage background..." Fine, given that background you don't have that knowledge. Not a problem—get it. If nothing else, view completely through Cheryl's tutorial, then work it through using the resources that can be downloaded with it. Then go to http://w3schools.com/ and work through all of the HTML and CSS tutorials there. Believe it or not, you are not any better than anyone else, and you don't get to skip the grunt work that everyone else has done to be able to answer your questions.

    You want to be a Web developer? Then act like one. Do your homework, practice what you learn, and then if needed, come back and ask meaningful questions. Otherwise, as TB has pointed out, take your own advice and ignore the pointed responses you'll get if you continue your present practice.

    cheers,
    scott


    C'mon, folks. This isn't rocket science, nor neurosurgery. It's "Expression" (singular) "Web" (singular), in that order, followed by a version numeral if you wish to be specific. It is often abbreviated "EW." It is not "Web Expression," "Expressions Web," "Web Expressions," or plain "Expression" or "Expressions." Not using the correct name indicates either ignorance or laziness. Most folks would rather avoid the appearance of either.
    Wednesday, April 28, 2010 5:49 PM
  • You have said that you have worked through Cheryl's "Build a Basic Web Site" video tutorial, and I'll tell you straight up, I don't believe you. I have viewed and worked through that tutorial and you could not possibly have done so and still need to ask some of the questions you are asking here, unless you have the IQ of a carrot.

    Although I came to Expression Web with well over a decade of experience with HTML and CSS, and Dreamweaver, I had no clue about EW itself. I saw that tutorial as an excellent way to familiarize myself with the EW user interface, and it was. By the time I was done, I was also impressed by the amount of training using standards-compliant markup and CSS in page development that the tutorial contained, and wrote an extensive review of the tutorial which, AFAIK, is still posted on that page.

    You clearly and expressly have stated that you do not have that background of experience and knowledge, pleading repeatedly that, "Remember, I come from a FrontPage background..." Fine, given that background you don't have that knowledge. Not a problem—get it. If nothing else, view completely through Cheryl's tutorial, then work it through using the resources that can be downloaded with it. Then go to http://w3schools.com/ and work through all of the HTML and CSS tutorials there. Believe it or not, you are not any better than anyone else, and you don't get to skip the grunt work that everyone else has done to be able to answer your questions.

    You want to be a Web developer? Then act like one. Do your homework, practice what you learn, and then if needed, come back and ask meaningful questions. Otherwise, as TB has pointed out, take your own advice and ignore the pointed responses you'll get if you continue your present practice.

    cheers,
    scott

    Typically when someone has been working through a tutorial and have a problem understanding they post along the lines of "in the 'xyz' tutorial it say [whatever] but when I try it I don't get [the expected result] here's my page. What am I doing wrong? " or something like that. 

    That gives people context that allows them to help instead of general questions that folks can't do much more with than point to tutorials.


    MS MVP Expression Tutorials & Help http://by-expression.com
    Wednesday, April 28, 2010 9:22 PM
  • Tony, have you considered starting with a premade CSS layout and tweeking it from there? Sounds like there's still a lot for you to learn about CSS, but starting with an existing layout may help you get some progress on your current project while you try to get up to speed on CSS et al.

    Here are some page layouts in the Expression gallery:

    http://gallery.expression.microsoft.com/en-us/site/search?f%5B0%5D.Type=RootCategory&f%5B0%5D.Value=templates&f%5B0%5D.Text=Web%20Templates

    Anna


    http://blogs.msdn.com/anna
    Wednesday, April 28, 2010 10:13 PM
    Moderator