473,387 Members | 1,556 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Safari giving problem with {display:none}

hsriat
1,654 Expert 1GB
All the elements which were set as style={display:none} are still being shown in Safari (Apple's Browser)...

But when the same style is applied with javascript on an event, it hides the element.
Like this...
Expand|Select|Wrap|Line Numbers
  1. document.getElementById('abc').style.display='none';
This one is also not working:
[HTML]style="{background-image:url('/img/logo.png');background-repeat:no-repeat}" [/HTML]

Both are working all good with Firefox, Opera and even IE 6 (which I actually didn't expect).

What could be the reason?
Feb 12 '08 #1
2 19418
Death Slaught
1,137 1GB
If you're using them as inline styles simply remove the curly braces.

Expand|Select|Wrap|Line Numbers
  1.  style="display:none;"
As for the image do the same and add a space between the colon and 'url'.

Expand|Select|Wrap|Line Numbers
  1.  style="background-image: url('location');"
Thanks,
{\_/}
(' . ')
(")[DEATH](")
(")(")
Feb 12 '08 #2
hsriat
1,654 Expert 1GB
If you're using them as inline styles simply remove the curly braces.

Expand|Select|Wrap|Line Numbers
  1.  style="display:none;"
As for the image do the same and add a space between the colon and 'url'.

Expand|Select|Wrap|Line Numbers
  1.  style="background-image: url('location');"
Thanks,
{\_/}
(' . ')
(")[DEATH](")
(")(")
oo.... thats working now!!
Thanks a lot!!! :)

Can you please tell me one more thing...
[HTML]<a class="button" id="ax1" href="javascript:void(0)" onclick='edit('x1')">&nbsp;Edit&nbsp;</a>[/HTML]

and function edit(id) is
Expand|Select|Wrap|Line Numbers
  1. function edit(id) {
  2.     var anc = document.getElementById('a'+id);
  3.      anc.innerHTML = anc.innerHTML=="&nbsp;Save&nbsp;" ? "&nbsp;Edit&nbsp;" : "&nbsp;Save&nbsp;";
  4. }
This is working fine with Firefox and IE, ie, the name of the A element gets changed from ' Save ' to ' Edit ' and ' Edit ' to ' Save ' on every click. But Opera and Safari are not doing any change.
If I remove the &nbsp; from both, then its working fine with all.
But since its a button kind of look, so I need to give space on both sides of the name.

How can I solve this?
Feb 13 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up the form using <div> tags. Each <div...
10
by: JayB | last post by:
I'm using a style to hide a skip navigation link but it's not working out correctly. The style is: ..textBrowsersOnly { display: none; } I'm using it in a paragragh and in a navigation link...
1
by: fleemo17 | last post by:
For increased accessibility, I've replaced "display:none" with the Off-Left method of hiding my CSS drop-down menus because the Jaws screen reader doesn't see any of the menus hidden with...
2
by: 4MLA1FN | last post by:
i'm building a little web app for my research project. url is here: http://www.cognitivecomposites.com/wtf/ it validates as xhtml/strict according to: ...
2
by: Good Man | last post by:
Hi there I have quite a bit of experience with CSS but I am stumped by the following: http://www.electricphase.com/example/example1.php (uses http://www.electricphase.com/example/test1.css) ...
7
by: Janis | last post by:
I try to understand what could be the source of a problem with displaying and hiding rows of tables using display:block/none. I've read selfhtml but could not find any hint about that. Any...
7
by: bissatch | last post by:
Hi, I ocasionally use display: none; to hide divs that, on the click of a link they will reappear. For example, maybe I create a menu and when you click a link of menu options the submenu...
7
by: khinester | last post by:
Hello, I have the following template that basically does the following: User select Country, then a sub-list is generated with Regions and then this returns the Counties ############### ...
2
hsriat
by: hsriat | last post by:
Maximum how many elements can be made hidden by giving STYLE={DISPLAY:NONE} in a single HTML file. Any restriction?... If it is there.. any way out as I want to make 110 rows with DISPLAY:NONE...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.