Haml - adding a display:none to a p tag isn't working

css, haml

Solution

Your Haml is correct, in that it generates the style attribute correctly, but your HTML is wrong. A `h4` element is not allowed as a direct child of a `p` element, so the browser implicitly closes the `p` before the `h4`. In effect you hava an empty `p`, which has `display:none` set.

Try changing the `p` to a `div`, which is allowed to have `h4` as a child. (You might want to alter the other contents too).

Problem

I am trying to do this: ``` %p{:style=>"display:none;"} %h4= t("labels.shortened_urls.fqdn_url") =f.url_field :fqdn_url, {:readonly => true} %small=link_to((t "links.shortened_urls.view"), :target => :_blank) ``` but I can not get it to stop displaying. Is there something I am not doing correctly with the first line there? Thanks!

Original source