Richard Coffre
asked on
Set fieldset side by side
Hi all,
So far I have my fieldset blocks set one below the other (see the screenshot attached).
But I want to put them side by side.
How could I do this ?
Thanks in advance.
fieldset-above.png
So far I have my fieldset blocks set one below the other (see the screenshot attached).
But I want to put them side by side.
How could I do this ?
Thanks in advance.
fieldset-above.png
ASKER
Hi SoupBoy,
I try to use it as follows but it failed :
with the following CSS code :
I try to use it as follows but it failed :
<div id="contact">
<fieldset>
<legend>Porteur projet</legend>
<input id="titreSite1" name="titreSite1" type="text" value="Chef etablissement">
<br />
<label for="civiliteSite1">Civilité</label>
<input id="civiliteSite1" name="civiliteSite1" type="text" value="Monsieur">
<input id="nomSite1" name="nomSite1" type="text" value="COSTE">
<input id="prenomSite1" name="prenomSite1" type="text" value="Patrick">
<br />
<label for="telSite1">Téléphone</label>
<input id="telSite1" name="telSite1" type="tel" value="0534098230">
<label for="mobileSite1">Mobile</label>
<input id="mobileSite1" name="mobileSite1" type="tel" value="">
<br />
<label for="mailSite1">Courriel</label>
<input id="mailSite1" name="mailSite1" type="email" value="0090002D@ac-toulouse.fr">
</fieldset>
<fieldset>
<legend>Porteur projet 2</legend>
<input id="titreSite1" name="titreSite1" type="text" value="Chef etablissement">
<br />
<label for="civiliteSite1">Civilité</label>
<input id="civiliteSite1" name="civiliteSite1" type="text" value="Monsieur">
<input id="nomSite1" name="nomSite1" type="text" value="COSTE">
<input id="prenomSite1" name="prenomSite1" type="text" value="Patrick">
<br />
<label for="telSite1">Téléphone</label>
<input id="telSite1" name="telSite1" type="tel" value="0534098230">
<label for="mobileSite1">Mobile</label>
<input id="mobileSite1" name="mobileSite1" type="tel" value="">
<br />
<label for="mailSite1">Courriel</label>
<input id="mailSite1" name="mailSite1" type="email" value="0090002D@ac-toulouse.fr">
</fieldset>
</div>
with the following CSS code :
#contact fieldset{
float: left;
width: 50%;
margin: 0;
padding: 0;
box-sizing: border-box;
}
You must have other CSS rules affecting it... I put your HTML and CSS here and it works as expected...
Can you post a link to your page and we can take a look at it in chrome devtools?
Can you post a link to your page and we can take a look at it in chrome devtools?
ASKER
This is the link : http://pouxdagouti.org/ast er/seeElts Adm.php
Nothing else seems as if it would affect it...though I didn't see the new code added. I think the issue is probably a browser issues and the box-sizing rule.
What browser are you using?
Try using this css:
What browser are you using?
Try using this css:
#contact fieldset{
float: left;
width: 50%;
margin: 0;
padding: 0;
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
box-sizing: border-box; /* Opera/IE 8+ */
}
Attached is a screen shot showing the modifications made within Chrome's Dev Tools. Notice the contact fieldsets are side by side...
contactSideBySide.PNG
contactSideBySide.PNG
ASKER
I use Chrome.
I added the div id="contact" in the HTML file and the definition associated in the CSS file.
I added the div id="contact" in the HTML file and the definition associated in the CSS file.
ASKER
I will check one more time tomorrow.
Thanks a lot for your help.
Thanks a lot for your help.
In the link you provided, I do not see the new CSS rules.... can you send me an updated link with the new CSS rules in place? Then I can take a look as to why it isn't working.
ASKER
Hi soupBoy,
I have updated everything.
I can see the new rules but it still failed.
I have updated everything.
I can see the new rules but it still failed.
can you send me a new link? I checked the rules for those elements and I don't see the changes....
Without seeing more of your code (or a link) I wouldn't know what to tell you....
Without seeing more of your code (or a link) I wouldn't know what to tell you....
ASKER
Hi soupBoy,
At the link : http://pouxdagouti.org/ast er/seeElts Adm.php
Everything is updated.
The code is the one showed above and the last version of the CSS file as the last update as follows :
I think I did everything you advice me to do.
So I don't understand why it failed so far.
At the link : http://pouxdagouti.org/ast
Everything is updated.
The code is the one showed above and the last version of the CSS file as the last update as follows :
#contact fieldset{
float: left;
width: 50%;
margin: 0;
padding: 0;
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
box-sizing: border-box; /* Opera/IE 8+ */
}
I think I did everything you advice me to do.
So I don't understand why it failed so far.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Hi,
All the other rules are applied correctly.
I will try your solution by putting the rules in a style section directly in the HTML code.
All the other rules are applied correctly.
I will try your solution by putting the rules in a style section directly in the HTML code.
ASKER
Very helpful assistance.
soupBoy really helped to find the accurate solution, even in this tricky situation.
soupBoy really helped to find the accurate solution, even in this tricky situation.
ASKER
Hi soupBoy,
When I put the <style> directly in the code, it works.
When I put the <style> directly in the code, it works.
The idea is you can 'float: left' the fieldset with a 'width: 50%', using 'padding: 0' and 'margin: 0' AND (the important one) 'box-sizing: border-box', it will allow them to sit side by side.
Here is the code.....
HTML:
Open in new window
CSS:
Open in new window