[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

MX 2004 view div with display: none

Posted on 2005-04-28
6
Medium Priority
?
172 Views
Last Modified: 2010-04-25
A change between Dreamweaver MX versions:

· Design view of Dreamweaver MX shows <div>'s with "display: none;" (vs. "display: block;").
· Design view of Dreamweaver MX 2004 does NOT show them.

How can I view <div>'s with "display: none;" in Dreamweaver MX 2004?

0
Comment
Question by:controltheweb
  • 3
  • 2
6 Comments
 
LVL 19

Expert Comment

by:webwoman
ID: 13892058
I doubt you can. They aren't there. You told them not to be there. That's what 'display:none' does.

WHY are you hiding them? If you don't want them there, don't put them there. If you want to show/hide something, you'll need to use javascript and it would be a good idea if you understood what you were doing.
0
 
LVL 10

Accepted Solution

by:
Havin_it earned 700 total points
ID: 13908236
Hi,

MX 2004 has deliberately ramped up the accuracy of its display of CSS elements.  If (as I suspect) you want to be able to edit the div visually on-the-fly, the best way would be to duplicate its CSS class, and change the display attribute in the duplicate to 'block'.

That way, you can pop open the code-view, place your cursor within the div tag, and click the duplicate class in the Styles panel to make it visible. When you're done, click on the original class to make it display:none again.

webwoman raises a good point: I'm assuming you will be using some Javascript to play with these divs; if you were only using them to hold invisible text for, say, SEO purposes, bear in mind that search engines are committed to detecting and penalising 'tricks' such as this.
0
 
LVL 3

Author Comment

by:controltheweb
ID: 14064031
Webwoman:
· Thanks for asking why I am hiding them:

I am hiding them in conjunction with JavaScript, as I have done for many years, so that viewers can have additional information appear on the page when they click. The most common use of them, I'm sure. Nothing to do with SEO/SEM or ignorance. Other editors (such as Dreamweaver MX) allow you to view them. A very popular use of JavaScript  and "display: none;" from what I see browsing the web.

I use Javascript and CSS together to achieve the always nifty show/hide effect thusly:

<script type="text/javascript">
function toggleLayer(whichLayer)
{
      if (document.getElementById)
      {
            // standards
            var style2 = document.getElementById(whichLayer).style;
            style2.display = style2.display? "":"block";
      }
      else if (document.all)
      {
            // old IE versions
            var style2 = document.all[whichLayer].style;
            style2.display = style2.display? "":"block";
      }
      else if (document.layers)
      {
            // nn4
            var style2 = document.layers[whichLayer].style;
            style2.display = style2.display? "":"block";
      }
}
// Reminder: <a href="javascript:toggleLayer('yourdDivname');">text of link goes here</a>
</script>
<style type="text/css">

div#hiddenSectionB
      {
            display: none;
            margin: 0px 0px 0px 0px;
            font-size: 12px;
            font-family: Arial, Helvetica, sans-serif;
            color: #111111;
      }

I see you have a lot of AWESOME certifications at EE, so thanks very much for making EE such a great place. Thanks especially for the humorous tone of your post. (If it wasn't intended as humor, I hope you are feeling better! Somebody need a hug? <HUG>)
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 19

Expert Comment

by:webwoman
ID: 14083047
If you're creating the javascript, and understand what you're doing, edit them in code view and NOT design view. You'll have no problem 'seeing' them in code view, and you can edit them to your heart's content without having to change the CSS or visibility of them.

If you're not creating the javascript and don't understand what you're doing, you're really, really limiting yourself.
0
 
LVL 3

Author Comment

by:controltheweb
ID: 14085437
I create the JavaScript, but prefer to edit the text in design view. (Hence the question.) The old view was very handy, especially for multiple <div>'s. (Hence the question.) Of course, now I AM editing in design view, as there is no other choice. (Hence the question.)
0
 
LVL 19

Expert Comment

by:webwoman
ID: 14092134
Of course there's another choice - code view. If you're editing text, it really doesn't make much difference. Text is text. You can use preview in browser to see how it looks and whether it works or not.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question