The legend in the fieldset is not displaying correctly due to overflow issues

Within my fieldset, there is a legend structured as shown below:

<fieldset class="fieldsetStyle">
            <legend class="fieldsetLegendStyle">

                <div>
                     <h:outputText value="#{msgs.LABEL_AJOUTER_UTILISATEUR}"
                         rendered="#{gProfilCtrl.newUtilisateur}"/>
                     <h:outputText value="#{msgs.LABEL_MODIFIER_UTILISATEUR}"
                         rendered="#{!gProfilCtrl.newUtilisateur}"/>
                </div>

            </legend>
.
.
.
</fieldset>

After setting the overflow property to auto in my CSS file, the legend displays incorrectly. In Chrome browser, the top border disappears while Firefox and IE render it correctly.

Below is the CSS code I have used:

.fieldsetStyle {
    height: calc(100% - 2px);
    border: 1px solid #bed6f8;
    margin-left: 5px;
    padding: 0 0 0 30px;
    width: calc(100% - 37px);
    margin-right: 0px;
    overflow: auto;
}

.fieldsetLegendStyle {
    border: 1px;
    border-style: solid;
    border-color: #BED6F8;
    min-width: 199px;
    height: 25px;
    padding-top: 10px;
    margin-bottom: 20px;

}

Any suggestions or solutions to address this issue?

UPDATE

If I remove overflow:auto, my panel extends beyond the fieldset box.

Answer №1

One potential solution is to encase the <fieldset> within a <div> and apply the necessary styles to the div element.

Alternatively, you could adjust the positioning of the <legend> by moving it down one pixel in order to display the top border correctly.

.fieldsetLegendStyle {
    position: relative;
    top: 1px;
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

HTML and CSS display differently on Internet Explorer browsers

Why is the code displayed differently in IE11, showing up on two lines for some reason? The code has been simplified for display purposes here, which may make it look odd visually. HTML <ul class="nav navSilver" style="border: 1px solid green;"> ...

What is the best way to superimpose an image onto a canvas?

I am working on a cool project where I have created a canvas that displays matrix binary code raining down. However, I would like to enhance it by adding an image overlay on top of the canvas. Here is my current setup: <div class="rain"> ...

Exploring the concept of D3 data binding key accessor

Exploring D3 for the first time, I am working on a basic example to grasp the concept of data binding. My setup includes an array of colors, a function to add a color, and a function to remove a color based on index. However, I'm facing issues with t ...

Trying to retrieve a CSS property using jQuery

Having trouble retrieving the correct CSS value for a background using a spectrum.js color picker. No matter which color is chosen, rgba(0,0,0,0) is always selected. Strangely enough, when checking the background in the console, it shows up correctly in th ...

The impact of animation on vertical scrolling distance

At the moment, I'm utilizing the animation library found at . Whenever I trigger my confetti animation, the Y Scroll steadily rises until the animation completes. I'm curious if there's a method to cap the y-scroll at a certain height. I wo ...

What are the steps for printing a webpage in landscape orientation using Firefox and IE11?

@page { size: 11in 8.5in; } This code snippet did not achieve the desired result in Internet Explorer or Firefox. The transform: rotate(270deg); property only worked for the first page. ...

Issue with IE7 causing div elements to slide off the screen on specific WordPress pages

Encountering a strange IE7 bug on two pages of a WordPress site I'm currently developing. Some divs are shifting to odd positions, with one completely off the screen: and another here: Additionally, possibly related or not, the "created by" link in ...

Variations in functionality within the Google Chrome browser

This is the content of my HTML document. <BODY> <button id="b1" onclick="load()">Play</button> <canvas id="c1" onclick="f_clicked(this.id,1)"> Your browser does not support the HTML5 canvas tag. </canvas> ...

I am looking to incorporate one word in my heading to be displayed horizontally, with the second word flowing vertically

I am designing a website and looking to create a unique effect with the text in my title/h1 tag. I want the first word to be displayed horizontally and the second word vertically. My attempt using span tags in the h1 element only allowed me to change the ...

Harmonizing controls with ASP.NET using CSS styling

I have created a web form application which is displayed in the image provided. However, when I view the same page in the browser, the output appears completely misaligned despite the designer file being perfect. The markup for this form is quite lengthy ...

What is the best way to make IE reload a flash.swf file each time the page is accessed?

Upon visiting our site, users are greeted with a dynamic coverflow display. For those who are not logged in, the images remain invisible. However, upon logging in, users should be able to see the images in the coverflow. Unfortunately, due to caching, the ...

Utilizing the Grid-A-Licious plugin multiple times within a single webpage

Currently, I am utilizing the Grid-A-Licious plugin for my project. It functions perfectly when used on a single page with one call to the plugin. However, due to my design requirements, I need to implement it within 3 tabs on the same page. Unfortunately, ...

Leveraging AJAX for seamless PHP execution without page refresh

I have this HTML form: <form class="clearfix" method="POST"> <input name="username" type="text" placeholder="Username:"> <input name="password" type="password" placeholder="Password:"> <textarea name="comment" placeholder="Comment: ...

What is the significance of vh and percentage values in CSS?

Can anyone help me figure out why the .navbar is not displaying correctly on half of the screen? I think there might be another container causing the issue, but I'm unsure. I've set the body to 100vh to cover the entire screen The .navbar ...

`CSS3 animations utilizing keyframes and transformation`

Looking to replicate a similar effect using CSS animations: I've created a file working with keyframes for the animation, but it's not functioning as desired. My goal is to have the circles complete a full rotation on their axis, starting from ...

What is the best way to center a navbar vertically inside a div?

I've come across some posts mentioning the need for a container with h-100 to align items using the align-self class. However, I'm facing issues aligning a navbar at the bottom of a div. When I place the navbar within another container and row, i ...

Display the element solely when the user enters a value greater than 0 into the input box

I am in the process of developing a WoW Classic statistics calculator that allows users to select a class and input various values. As the user makes changes to the inputs, the calculations are displayed below the form using vanilla JS and jQuery. I am ple ...

Generating HTML tables with charts using FireFox

I am encountering an issue: My table contains charts and tables that are displayed correctly in browsers. However, when I attempt to print it (as a PDF) in Mozilla Firefox, the third speedometer gets cut off, showing only 2.5 speedometers. Using the "s ...

The IIS webpage encountered an error while attempting to load a file or assembly

I am faced with an issue while attempting to launch a second website on my Windows server using IIS manager. To create the second website, I duplicated and renamed the source folder of my first website, which is currently operational. The intention is to h ...

Utilizing Bootstrap for Proper Alignment of "Link" and "Label"

Even though I have used "href" and a "label", the alignment is still off. Both elements are in the same line, but "My Text" appears slightly higher than "myImage". <div class="col-md-6 bottom"> <a href="~mydata"><img src="~/Images/myI ...