fieldset code

Open to all! Ask other shopowners for help.
User avatar
ReneH4
Contributor
Posts: 145
Joined: Mon Oct 26, 2020 12:00 pm
Phoenix Version:
Has thanked: 13 times
Been thanked: 17 times

fieldset code

Post by ReneH4 »

I just found the fieldset code.

I entered it in a few modules, but somehow it does not display a box.

Is it overwritten by other classes? Running 1079.

Code: Select all

<fieldset style=" border-radius: 8px; border: 1px solid black; width: 500px; margin: 1em auto;">
	<legend style="width: 100%; padding: 0;">
		<div style="display: inline-block; line-height: 1.2;">
			<div style="float: left; padding: 0 5px;">Legend</div>
			<div style="float: left; height: 1px; background-color: black; width: 359px;  margin-top: 11px;"></div>
			<div style="float: left; padding: 0 5px;">Other Stuff</div>
		</div>
        
        

	</legend>	
    
Some tect or variable here......
</fieldset>


Join The Code Co-op to get access to your library in the Code Co-op Forum
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: fieldset code

Post by ecartz »

ReneH4 wrote: Sat Feb 05, 2022 7:10 pm Is it overwritten by other classes? Running 1079.
What you've written is pure HTML with the style attributes set. You don't say where you put it, so we can't say anything about PHP classes. But you can't override it with CSS classes, because CSS can't override the style attribute. In general, it won't play nice with Bootstrap, so it will likely look odd in things where Bootstrap is expecting to be able to apply its own sizing. It would be better to use a Bootstrap-based example rather than the style attribute. But that's unlikely to cause it not to appear.

The more likely problem is that you're ending up with invalid HTML and browsers are just skipping over it entirely. Throw the page in a validator and see what it says.
User avatar
ReneH4
Contributor
Posts: 145
Joined: Mon Oct 26, 2020 12:00 pm
Phoenix Version:
Has thanked: 13 times
Been thanked: 17 times

Re: fieldset code

Post by ReneH4 »

Will try, thanks Matt!
ecartz wrote: Sat Feb 05, 2022 10:15 pm
ReneH4 wrote: Sat Feb 05, 2022 7:10 pm Is it overwritten by other classes? Running 1079.
What you've written is pure HTML with the style attributes set. You don't say where you put it, so we can't say anything about PHP classes. But you can't override it with CSS classes, because CSS can't override the style attribute. In general, it won't play nice with Bootstrap, so it will likely look odd in things where Bootstrap is expecting to be able to apply its own sizing. It would be better to use a Bootstrap-based example rather than the style attribute. But that's unlikely to cause it not to appear.

The more likely problem is that you're ending up with invalid HTML and browsers are just skipping over it entirely. Throw the page in a validator and see what it says.
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: fieldset code

Post by heatherbell »

ReneH4 wrote: Sat Feb 05, 2022 7:10 pm I entered it in a few modules, but somehow it does not display a box.
I *think* you cannot have a <div> as a child of <legend> and those <div>s are breaking it so try without those <div>s
User avatar
ReneH4
Contributor
Posts: 145
Joined: Mon Oct 26, 2020 12:00 pm
Phoenix Version:
Has thanked: 13 times
Been thanked: 17 times

Re: fieldset code

Post by ReneH4 »

I tried that already.

The text is there but not the pretty box.....

I had it entered in the products description like in the attachement.

Code, no more no less:

Code: Select all

<fieldset><legend>TEST:</legend> TEXT</fieldset>
heatherbell wrote: Sun Feb 06, 2022 10:24 am
ReneH4 wrote: Sat Feb 05, 2022 7:10 pm I entered it in a few modules, but somehow it does not display a box.
I *think* you cannot have a <div> as a child of <legend> and those <div>s are breaking it so try without those <div>s
You do not have the required permissions to view the files attached to this post.
User avatar
ReneH4
Contributor
Posts: 145
Joined: Mon Oct 26, 2020 12:00 pm
Phoenix Version:
Has thanked: 13 times
Been thanked: 17 times

Re: fieldset code

Post by ReneH4 »

I saw the idea on this site and like the boxes:

https://www.123inkt.nl/Inkt-cartridges/ ... p2969.html

Wanted to play around a bit an see if it's usefull...
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: fieldset code

Post by ecartz »

ReneH4 wrote: Sun Feb 06, 2022 11:17 am
Code, no more no less:

Code: Select all

<fieldset><legend>TEST:</legend> TEXT</fieldset>
Maybe

Code: Select all

<fieldset class="border border-3 rounded-pill"><legend>TEST:</legend> TEXT</fieldset>
User avatar
ReneH4
Contributor
Posts: 145
Joined: Mon Oct 26, 2020 12:00 pm
Phoenix Version:
Has thanked: 13 times
Been thanked: 17 times

Re: fieldset code

Post by ReneH4 »

That shows the "bucket" (with a radius of 50), but not the cover of the "bucket".

Image 1 shows with radius 50 on, the second with radius off.
ecartz wrote: Sun Feb 06, 2022 11:28 am
Maybe

Code: Select all

<fieldset class="border border-3 rounded-pill"><legend>TEST:</legend> TEXT</fieldset>
You do not have the required permissions to view the files attached to this post.
User avatar
ReneH4
Contributor
Posts: 145
Joined: Mon Oct 26, 2020 12:00 pm
Phoenix Version:
Has thanked: 13 times
Been thanked: 17 times

Re: fieldset code

Post by ReneH4 »

I also tried to insert this code into the order confirmation message, but unfortunately it is not supported for mail....

Sometimes things look so easy ;-)
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: fieldset code

Post by heatherbell »

ReneH4 wrote: Sun Feb 06, 2022 12:54 pm Sometimes things look so easy ;-)
LOL - I know that feeling well!
A quick Google shows on Stackoverflow that others also have issues with <fieldset> and Bootstrap https://stackoverflow.com/questions/459 ... -bootstrap
so you might have to rethink your approach.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply