Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Header formatting and tabs headaches

1497551708

Edited 1497552341
XophRA
Pro
Marketplace Creator
Sheet Author
I building character sheets for my game Free Spacer. I have a header on the top and want to put a button (or tabs if I can't do that) that allow me to have more than type of sheet.&nbsp; Free Spacer Crewmember Contingency type Corvette Ship Launch Issue 1: The buttons are not clickable. Issue 2: Formatting the header is hinky&nbsp; I'm posting the code that (I think) matters. Here is the HTML code: &lt;header&gt; &lt;h1&gt;&lt;img class="sheet-BGImg" src="<a href="http://www.freespacer.com/wp-content/uploads/2016/06/FSLogoSquareTrans_100.png" rel="nofollow">http://www.freespacer.com/wp-content/uploads/2016/06/FSLogoSquareTrans_100.png</a>" alt="Free Spacer"&gt;Free Spacer&lt;/h1&gt; &lt;input type="radio" name="attr_selectedSheet" class="sheet-typeSelector sheet-crewmemberSelector" value="1" checked="checked"&gt;&lt;span title="Free Spacer Crewmember"&gt;&lt;/span&gt; &lt;input type="radio" name="attr_selectedSheet" class="sheet-typeSelector sheet-shipSelector" value="2"&gt;&lt;span title="Contingency type Corvette"&gt;&lt;/span&gt; &lt;input type="radio" name="attr_selectedSheet" class="sheet-typeSelector sheet-launchSelector" value="3"&gt;&lt;span title="Ship Launch"&gt;&lt;/span&gt; &lt;/header&gt; &lt;hr /&gt; &lt;!-- Character Sheet --&gt; &lt;div class="sheet-sheetType sheet-crewmemberSheet"&gt; &lt;/div&gt; &lt;!-- Ship Sheet --&gt; &lt;div class="sheet-sheetType sheet-shipSheet"&gt; &lt;/div&gt; &lt;!--Launch Sheet--&gt; &lt;div class="sheet-sheetType sheet-launchSheet"&gt; &lt;/div&gt; Here is the CSS /* Multiple Sheet Functionality */ div.sheet-sheetType { display: none; } input.sheet-crewmemberSelector:checked ~ div.sheet-crewmemberSheet, input.sheet-shipSelector:checked ~ div.sheet-shipSheet, input.sheet-launchSelector:checked ~ div.sheet-launchSheet { display: block; } input.sheet-typeSelector { width: 150px; height: 20px; position: relative; top: 150px; left: 400px; cursor: pointer; z-index: 1; opacity: 0; } input.sheet-typeSelector + span::before { content: attr(title); border: solid 1px #a8a8a8; text-align: center; display: inline-block; background: #fff; width: 150px; height: 20px; font-size: 10px; position: absolute; top: 150px; left: 400px; } input.sheet-shipSelector + span::before { left: 550px; } input.sheet-launchSelector + span::before { left: 700px; } /*General Sheet Style*/ body { font-family: "PT Sans", Helvetica, sans-serif; font-size: 1em; color: #000; background-color: #FFF; line-height: 150%; } header { display: block; } img.sheet-BGImg&nbsp; { z-index:-1; } h1, h2, h3, h4 { font-variant: small-caps; font-weight: 500; } h1 { font-size: 2em; } h2 { font-size: 1.3em; } h3 { font-size: 1.1em; } h4 { font-size: 0.9em; } td, p { font-size: 1em; white-space: nowrap; } br { font-size: 0.5em; height: 50%; } hr { border-top: 1px solid #D3D3D3; }
1497553518
XophRA
Pro
Marketplace Creator
Sheet Author
Can I use a select instead? With HTML like this: &lt;header&gt; &lt;h1&gt;&lt;img class="sheet-BGImg" src="<a href="http://www.freespacer.com/wp-content/uploads/2016/06/FSLogoSquareTrans_100.png" rel="nofollow">http://www.freespacer.com/wp-content/uploads/2016/06/FSLogoSquareTrans_100.png</a>" alt="Free Spacer"&gt;Free Spacer&lt;/h1&gt; &lt;select name="attr_selectedSheet" class="sheet-typeSelector"&gt; &lt;option value="1"&gt;Free Spacer Crewmember&lt;/option&gt; &lt;option value="2"&gt;Contingency type Corvette&lt;/option&gt; &lt;option value="3"&gt;Ship's Launch&lt;/option&gt; &lt;/select&gt; &lt;/header&gt;
1497559477

Edited 1497559521
Lithl
Pro
Sheet Author
API Scripter
You can't use header. There is one header element allowed on a page, and it is a sibling to the single body element on the page. Your character sheet code is a descendant of body, and your character sheet code will be duplicated for each character in the campaign.
1497559849
XophRA
Pro
Marketplace Creator
Sheet Author
So no header at all? Or just don't put the tab code in it?
1497560748

Edited 1497560770
XophRA
Pro
Marketplace Creator
Sheet Author
Okay I removed the &lt;header&gt;&lt;/header&gt; entirely, but the radio buttons still don't work. I can manually change the attribute in the sheet and is changes pages, but clicking on them does nothing
1497562433
XophRA
Pro
Marketplace Creator
Sheet Author
Okay... I looked it up. I think you mixed up &lt;head&gt;&lt;/head&gt; with &lt;header&gt;&lt;/header&gt; you can only have one &lt;head&gt; per document. You can have multiple &lt;headers&gt;&nbsp;
1497564927
XophRA
Pro
Marketplace Creator
Sheet Author
Okay, It is an issue with the hidden radio not syncing up with the location of their replacements. Odd... its not happening on my other replacements.
1497570669
XophRA
Pro
Marketplace Creator
Sheet Author
So I'm having problems lining up my tabs with their radio buttons. I made them visible for trouble shooting. Because of the tab functionality I cant put them inside a div or any container. Anyone know how to fix this?
1497576299
XophRA
Pro
Marketplace Creator
Sheet Author
Okay, I figured it out. had to set the hidden to position: relative and the fakes to position: absolute &nbsp;then nudge it around. I also switched the &lt;header&gt; to a &lt;section&gt; ... not sure if it had any effect.
XophRA said: Because of the tab functionality I cant put them inside a div or any container. Anyone know how to fix this? For something similar, I linked one set of visible (stylized) radio buttons in a div to to a hidden set of radio buttons where they need to be. &nbsp;I used sheet workers to do the linking. For the radio buttons: set the opacity to "0.7" or so will let you see the real buttons temporarily so you can find it easier to align the hidden and fake spots.
1497613613
Jakob
Sheet Author
API Scripter
Coal Powered Puppet said: XophRA said: Because of the tab functionality I cant put them inside a div or any container. Anyone know how to fix this? For something similar, I linked one set of visible (stylized) radio buttons in a div to to a hidden set of radio buttons where they need to be. &nbsp;I used sheet workers to do the linking. For the radio buttons: set the opacity to "0.7" or so will let you see the real buttons temporarily so you can find it easier to align the hidden and fake spots. Why not let the invisible ones be checkboxes instead (with the same attribute name)? Then you don't need any sheet workers for the linking, Roll20 will do the job for you. And since the extra inputs are checkboxes, you don't get into trouble with the fact that only one out of a group of radios can be active at the same time.
1497622990
XophRA
Pro
Marketplace Creator
Sheet Author
Coal Powered Puppet yeah, turning off the&nbsp; opacity is exactly how I found the real issue. Jakob &&nbsp; Coal Powered Puppet , I'm not sure how having more radio or checkbox buttons would help me. I nudged them around until they overlapped, so the work now. The only thing better would be if I could replace the tabs with a pull down select or something similar as you are not supposed to change it during play.&nbsp;
1497629251
Jakob
Sheet Author
API Scripter
You can replace it with a select, if you want. You still need the radios/checkboxes, just set them to display:none (just to make it clear, you don't need the spans in this case). Then you can still use the css selector rules to show the tabs when they are selected. Like this &lt;!-- Put this wherever you want, including into some other container --&gt; &lt;select name="attr_selectedSheet" class="sheet-typeSelector"&gt; &lt;option value="1" selected&gt;Free Spacer Crewmember&lt;/option&gt; &lt;option value="2"&gt;Contingency type Corvette&lt;/option&gt; &lt;option value="3"&gt;Ship's Launch&lt;/option&gt; &lt;/select&gt; &lt;!-- The following needs to be in the same container --&gt; &lt;input type="checkbox" name="attr_selectedSheet" value="1" class="sheet-hidden sheet-crewmemberSelector" checked /&gt; &lt;input type="checkbox" name="attr_selectedSheet" value="2" class="sheet-hidden sheet-shipSelector" /&gt; &lt;input type="checkbox" name="attr_selectedSheet" value="3" class="sheet-hidden sheet-launchSelector" /&gt; &lt;!-- Character Sheet --&gt; &lt;div class="sheet-sheetType sheet-crewmemberSheet"&gt; &lt;/div&gt; &lt;!-- Ship Sheet --&gt; &lt;div class="sheet-sheetType sheet-shipSheet"&gt; &lt;/div&gt; &lt;!--Launch Sheet--&gt; &lt;div class="sheet-sheetType sheet-launchSheet"&gt; &lt;/div&gt; And CSS div.sheet-sheetType { display: none; } input.sheet-crewmemberSelector:checked ~ div.sheet-crewmemberSheet, input.sheet-shipSelector:checked ~ div.sheet-shipSheet, input.sheet-launchSelector:checked ~ div.sheet-launchSheet { display: block; } .sheet-hidden { display: none; }
1497630346

Edited 1497630381
XophRA
Pro
Marketplace Creator
Sheet Author
Awesome&nbsp; Jakob ! I half formed something similar in my frustration last night. I'm going to switch to this approach once I finish the launch sheet! BTW: Is there a way of giving the player choices when they add &lt;fieldset&gt; repeating objects? The launch has a choice of 7 distinct trailers; summarizing them into single &lt;select&gt; choices won't work too well.
1497634098
XophRA
Pro
Marketplace Creator
Sheet Author
Jakob your solution worked like a dream... I actually replaced the Title with the pull down and it looks pretty good.