Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-25-2013, 07:18 PM   PM User | #1
corbinsigle
New to the CF scene

 
Join Date: Mar 2011
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
corbinsigle is an unknown quantity at this point
Question Cross-Browser Functionality Troubles

Hello!

I found and edited a small piece of code that seems to only work in Google Chrome. My problem is that I'm using a free website builder, and it allows for a "custom HTML" field, so I can't have multiple style sheets. Everything needs to be internal. Again, this works exactly how I need it to in Chrome.

Is anyone willing to help me edit the code or revamp it completely? I will admit that I'm a self-taught noob and anything beyond html/css is foreign to me.

Code:
<html>

<head>
<style id="jsbin-css">
summary {outline: none; -webkit-tap-highlight-color: rgba(255, 255, 255, 0); font: bold 1em Arial, Helvetica, sans-serif; padding: 8px 0; position: relative; width: relative; }
summary::-webkit-details-marker {display: none}
summary:after{background: #888888;  border-color: blue; border-radius: 5px; content: "+"; color: #ffffff; float: left; font-size: 1.5em; font-weight: bold; margin: -5px 10px 0 0; padding: 0; text-align: center; width: 25px;}
details[open] summary:after {background: #000000; content: "-";}
</style>
</head>

<body>
    <details>
    	<summary> 
		Title Here
    	</summary>
    	<p>
		Information Here
    	</p>
    </details>
</body>

</html>
corbinsigle is offline   Reply With Quote
Old 02-25-2013, 07:30 PM   PM User | #2
Frankie
Regular Coder

 
Join Date: Sep 2011
Posts: 284
Thanks: 3
Thanked 32 Times in 32 Posts
Frankie is an unknown quantity at this point
<style id="jsbin-css">? Giving the style block an id? <details>, <summary>? As far as I know, those are non-existing tags. Maybe Chrome supports them, that would explain why it only works in Chrome.

I would suggest to start with the beginner's course at W3 Schools and to start coding manually. Or build a site with
Wordpress, although most topics here are about problems with that...
__________________
Frank

How to: Target IE in, Position in, Center in, Create a Fixed ('Sticky') Footer with, and Create a Drop-Down/Fly-Out Menu with CSS: Website Laten Maken Amsterdam.
Frankie is offline   Reply With Quote
Old 02-25-2013, 07:39 PM   PM User | #3
corbinsigle
New to the CF scene

 
Join Date: Mar 2011
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
corbinsigle is an unknown quantity at this point
Quote:
Originally Posted by Frankie View Post
<style id="jsbin-css">? Giving the style block an id? <details>, <summary>? As far as I know, those are non-existing tags.
The code does not work, even in Chrome, if the style ID is removed. As far as <details> and <summary>, they are common HTML5 elements used for making expandable lists.
corbinsigle is offline   Reply With Quote
Old 02-25-2013, 08:47 PM   PM User | #4
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,452
Thanks: 0
Thanked 498 Times in 490 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
Quote:
Originally Posted by corbinsigle View Post
The code does not work, even in Chrome, if the style ID is removed. As far as <details> and <summary>, they are common HTML5 elements used for making expandable lists.
HTML 5 is still at the stage where browsers are implementing different parts of what has been suggested so that people can try them out to work out what works and what doesn't. Only once all the suggestions that don't work have been stripped out and an agreement is reached that what is left is actually useful and will work will HTML 5 become a standard and only then will all the browsers look at implementing all of it instead of just the sections that they decide to test.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote
Old 02-26-2013, 08:10 PM   PM User | #5
Obsidian
New Coder

 
Join Date: Feb 2013
Posts: 28
Thanks: 1
Thanked 4 Times in 4 Posts
Obsidian is an unknown quantity at this point
I tested the code in Google Chrome, so far the code works correctly and drops down when the button is pressed.

Do note you should include the <!DOCTYPE HTML> right above the <html> tag as the doctype standard for HTML5.

What information/elements would you like included in this code?
Obsidian is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:55 PM.


Advertisement
Log in to turn off these ads.