Grow your CSS skills. Land your dream job.

min-width?

  • # December 22, 2011 at 12:31 am

    I am coding a site right now using dreamweaver. I like using dreamweaver to see how things come out in the visual editor. Sometimes things work well in the visual editor, other times they look funky. I just coded the navigation for the site I am working on and I noticed that the last link in the list was wrapping down under the horizontal navigation even though I did not put a width rule on the ul. It looked fine in the browsers. So I decided to set a min-width rule to the ul and now in the visual editor of dreamweaver things look good. I was just wondering what you guys thought. Is it a good practice to set a minimum width to things when you don’t really need to set the actual width at all?

    # December 22, 2011 at 3:55 am

    It sounds like you’re developing for x-amount of browsers + for dreamweaver. You’ll probably end up with quite a few headaches while trying to make it /also/ work in dreamweaver. It will also add to code bloat.

    If you want to continue doing that, by all means, go ahead :p – but I wouldn’t suggest it to anyone. Get used to using an awesome text editor, like sublimetext2. I use ALT + TAB to switch between the editor and the browser. It’s really just as quick as it is in Dreamweaver to click on the visual tab. You may use split-view in dreamweaver… I sometimes split-view with a normal text editor and browser. Make half the screen the editor and the other half the browser. If you use linux or OSx, you could also have the browser in 1 workspace and the editor in another. I do all of those.

    # December 22, 2011 at 5:49 am

    +1 to everything @jamy_za said.

    # December 22, 2011 at 6:02 am

    @cybershot – DW has suited me for most things but I feel it is sometimes limited when using the wysiwyg because it does not always give you the most accurate visual representation. I found this to a particular problem when creating a WordPress site but the alternative is simply use the selected browsers to render the code, rather than the wysiwyg. I think it is a good idea to learn sublimetext as well.

    # December 22, 2011 at 12:36 pm

    I shall repeat!

    Never, ever use DW’s Visual Mode as a way to do anything except modify text. It is not going to give you a proper representation of how browsers will render your code.

    # December 23, 2011 at 12:01 am

    I am not using the visual editor for coding. I am only using it to see how it renders the page. I have found that by hand coding a site in dreamweaver, the visual editor can help you make better code in the way that you make changes that work great in the browser as well as dreamweaver. The goal is to end up with a site that looks exactly the same way in dreamweavers visual editor as it does in the browser. To me it just feels perfect when it looks the same in dreamweaver as it does the browser.

    # December 25, 2011 at 6:57 am

    not to sound mean, but did you read any of the replies in this post. Everyone is helping you and you refuse to listen.

    # December 25, 2011 at 7:05 am

    DW shows ur site rendered in a completely other way than modern browsers do!

    # December 25, 2011 at 1:27 pm

    @springlab
    Of course I read all the responses. Everyone is missing my point. You guys stopped at dreamweaver. Go back and read my first post. You will see this question which was not at all answered

    “Is it a good practice to set a minimum width to things when you don’t really need to set the actual width at all? “

    I guess it is my fault for not explaining properly. I have found that it is entirely possible to get your site to display the same way in dreamweaver as it does in the browser. It gets a little more difficult when you use sliders, but it is possible. I have done it many times.

    Now you might ask, why would you do that? Why would you want to try and get the site to display the same in dreamweaver as it does in the browser? Again, I have found that dreamweaver has some really nice tools and options that can help code a site. I do not rely on the visual editor to code a site. I simply like it to display the same. I have coded sites where dreamweaver has helped me realize that I was coding css that really didn’t need to be there. Other times I have found that it helped me find code that should be there. I hand code everything. I am not using the visual editor to write code. I simply use it to inspect my site. I like the new inspect features that cs5 has. It works better than firebug.

    This thread turned into an argument about whether or not to use dreamweaver. Everyone avoided the actual question which I quoted above.

    I appreciate everyone who has contributed to the discussion. I think I just did a poor job of explaining really what I was after. I guess in the end, I was curious if dreamweaver was showing me a bug that the browsers just don’t care about so they render the code properly. I was just wanting to find that bug and squash it which would have made dreamweaver display the nav properly. Yeah, I think that is how I should have explained it to start.

    # December 25, 2011 at 9:51 pm

    I found a perfect example of what I am talking about. I put a slider into my site. It display perfectly on all browsers. When I look in dreamweavers visual editor, the entire layout is broken. It is broken because all the slides are going down the front page and pushing into the footer and content area. So i added a clear: both to the footer and now the layout in dreamweaver is fixed. This is a rule I would not have added to the code if not for dreamweaver since the site looks fine and dandy in the browsers.

    Rob
    # December 26, 2011 at 6:38 am

    min-width is useful when you want an element to not fall below a set size. It forces it to a minimum size while letting it expand to it’s max-width or whatever you need it to. So it’s great when you need it for that role – if you don’t need it and still set it – I suppose it could be argued that it is bad practice, but it falls more in the realm of pointlessness. If you don’t need it, don’t use it.

    On the subject of Dreamweaver – you said:

    I like using dreamweaver to see how things come out in the visual editor. Sometimes things work well in the visual editor, other times they look funky. I just coded the navigation for the site I am working on and I noticed that the last link in the list was wrapping down under the horizontal navigation even though I did not put a width rule on the ul. It looked fine in the browsers. So I decided to set a min-width rule to the ul and now in the visual editor of dreamweaver things look good.

    You should not look at it at all, it is a waste of time. Why? It will not help you making things look right in Dreamweaver because no one uses Dreamweaver visual editor to browse the web. Coding to make things look right in the visual editor of Dreamweaver will cause you more pain and confusion than any version of IE lol – and all for naught!

    The reason no one answered your question was the fact that it was made moot by the point that you are only using it to make things look ok in Dreamweaver visual editor. If you are not using the visual editor, then you don’t need to fix it.

    # December 27, 2011 at 1:29 am

    This:

    You should not look at it at all, it is a waste of time. Why? It will not help you making things look right in Dreamweaver because no one uses Dreamweaver visual editor to browse the web.

    And this:

    The reason no one answered your question was the fact that it was made moot by the point that you are only using it to make things look ok in Dreamweaver visual editor.

    # December 27, 2011 at 1:42 am

    I disagree that it is a waste of time to use dreamweavers visual editor. I have noticed that it is very accurate. Especially cs5. I have noticed in the site that I am coding now that it has been 100% accurate with I.E 9 so far. So it has shown me some things that I.E would show if Javascript was disabled. So I feel that by coding for dreamweavers visual editor as well as the browsers, you can write more complete code. Even though the browsers may not require it, you can still add the code to make your overall markup more complete. This is probably just one of those debates were half will say it’s good and the other half will say it’s bad. kind of like PC or Mac

    So when I disabled javascript and saw how it affected my slider, I found that fixing it in dreamweaver also fixed it in I.E. That is the point I have been trying to express. I think a lot of people have had trouble understanding this because none of you trust the visual editor or use it. I code on split view because I like to see how the borders are working. It gives me a visual cue of things that I need to fix or work on a little more.

    # December 27, 2011 at 2:11 am

    We’re saying you shouldn’t add extra code to make something work in DW’s visual editor. I’m not saying it’s not useful, I’m saying you shouldn’t waste your time fixing things for it.

    It is never, ever going to be 100% accurate – so why bother relying on it?

    # December 27, 2011 at 2:18 am

    Oh yes, that is a good point. Adding code just to fix it in dreamweaver could be a waste of time. I like to do it because I really like my site to display properly in dreamweaver so that I can see the borders and everything else properly. I can tell you right now that it is 98% perfect for the site that I am working on right now. There is one bug that I can’t figure out yet. I do understand what you are saying though

Viewing 15 posts - 1 through 15 (of 17 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".