`The <fieldset> element is positioned outside of the <div> element

I'm facing an issue with my markup that occurs when I resize the browser window.

Below is the ASP.NET code snippet:

<asp:Panel ID="PanelGrid" runat="server" CssClass="frame">
     <fieldset class="fs">                        
       <legend> 
         <asp:Label ID="Label" runat="server" Text="LALALA"></asp:Label>
       </legend>
      </fieldset>
    </asp:Panel>
    

The issue is that the border appears outside of the Panel element.

If I remove the <fieldset> tags, the result looks like this:

<asp:Panel ID="PanelGrid" runat="server" CssClass="frame">

       <legend> 
         <asp:Label ID="Label" runat="server" Text="LALALA"></asp:Label>
       </legend>

    </asp:Panel>
    

How should I adjust the CSS class ("fs") to work with the <fieldset> tag?

Thanks in advance!

P.S. Here is my CSS class code:

.frame {
        margin: 1px;
        padding: 3px;
        border: 1px solid Navy;
        background-color: White;
        font-size: 9pt;
        box-shadow: 0 0 5px 1px #1A3457;
        -webkit-box-shadow: 0 0 5px 1px #1A3457;
        -moz-box-shadow: 0 0 5px 1px #1A3457;
        border-radius: 5px;
    }
    

Answer №1

If you want the Panel control to automatically generate fieldset tags, all you need to do is set the GroupingText property:

    <asp:Panel runat="server" GroupingText="your fieldset group">
    </asp:Panel>

Answer №2

Check out this CSS code snippet:

.fs {
    width: 100%;
    overflow: scroll;
}

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

What is the best strategy for positioning an anchor element within a list item using JSX or Bootstrap in a way that maximizes efficiency?

I have the following code snippet <li className = "list-group-item list-group-item-success" key ={todo.id}>{todo.text}<a style="float:right;" onClick={() => props.onEdit(todo)} className="edit-todo glyphicon glyphicon-edit" href="#"& ...

Getting the outer span text with Selenium WebDriver and Java: A quick guide

Having an issue where I'm having difficulty extracting the text from a span tag that contains another nested span tag: <span class="abc"> <span class="def">Inner Span</span> Outer Span </span> Currently, when ...

Incorporating a span class into a freshly generated button

In my application, there is a section of code that displays buttons when needed. Currently, the button only shows the text provided to it. Now, I want to include a glyph alongside the button. Usually, I would use a span class for this purpose, but I' ...

Tips for customizing the appearance of Angular Material's autocomplete feature

Currently, I am working with Angular and implementing Angular Material components like md-autocomplete from [https://material.angular.io/components/autocomplete/api][1]. However, I am facing an issue trying to add a border radius to my md-autocomplete elem ...

Data not being saved when using the Post method in a Web API

I built a straightforward Web API application that allows users to GET or POST data. The data consists of a simple array of Strings like ["foo", "bar"]. However, when I try to send data using the POST method to the Web API and then make another call to ret ...

Substitute all instances of <table> with <div> tags, making sure to include specifications for

Currently, I find myself immersed in a project that relies heavily on tables, which isn't exactly ideal but is what the marketing department insists upon... To tackle this issue, I have implemented jQuery to convert all tables into DIVs, and so far, ...

What steps do I need to follow in order to adjust the timezone on ASP?

Currently, I am exploring methods to alter the time zone in asp. After some research, I discovered that it can be done through the web.config file. However, I am unsure how to adjust it to synchronize with the time zone in Jordan. ...

CSS3 Rounded Corners

What is the most effective method to create this style of border using only CSS3? PS: The width should be 100%, matching the size of the screen. ...

Border provides spacing within a div using the box-sizing property set to border-box

I am facing an issue where I have a div with the class "outer" containing another div with the class "inner". Upon adding a 2px border to the "outer" div, padding is automatically applied in a way that appears as 1px padding on the top, left, and right sid ...

Exploring AOP and Action Filters in the .NET Framework

Here are 2 inquiries: Would you classify Action Filters in MVC as Aspect Oriented Programming (AOP)? If so, is there a similar feature provided by .NET for non-MVC code (like a regular class library)? I am looking to implement logging in an application. ...

Another option instead of preloading images

Currently, I am in the process of creating a jQuery slideshow. After reviewing numerous tutorials on the subject, it appears that most recommend preloading images using code similar to the following: imageArray[imageNum++] = new imageItem(imageDir + "02. ...

What is the best way to halt Keyframe Animation once users have logged in?

To enhance user engagement, I incorporated keyframe animation into my login icon on the website. The main objective is to capture the attention of visitors who are not registered users. However, once a user logs in, I intend for the keyframe animation to c ...

What could be the reason behind my jQuery UI buttons suddenly appearing oversized and lackluster?

Previously, I utilized the jQuery UI to enhance button appearance. However, with this code snippet: else if (ui.newTab.index() == 3) { $('#MediaContent').load('Content/TwainMedia.html'); $('#MediaContent').css('b ...

Scroll to Reveal Content Hidden Behind Hero Image

I am absolutely enamored with the Beautiful Stories section on Medium's website. The way they showcase their content is just mesmerizing. One thing I've noticed is how the cover image and preview of the content changes as you resize your browser ...

Tips for navigating a dynamic viewport using scroll movement

Attempting to create a responsive page with two distinct sections at this example link including: Map View Table View Both of these views (table and map divs) need to be responsive without a hard-coded height, so the size of the map div adjusts automatic ...

Using pure JavaScript to trigger a pop-up window upon submitting a form

Struggling with sending form data to a PHP page using radio buttons for poll results display. No luck with passing variables using $_POST or $_GET methods. I've checked both, but still nothing. When I tried printing the arrays on the PHP page: <? ...

Expand the <div> by clicking on it, then hover away to return it to its normal size

One interesting feature I have on my website is a <div> that expands when clicked, and returns to normal size with another click. However, I am looking for something a bit different... What I want is for the <div> (with the class name .topHead ...

ASP.NET MVC Don't Repeat Yourself (DRY) concept

Recently, I've been working on a project that involves an Area named Admin. Within this Area, there is a class called MenuTab containing code logic used in both the Admin Area Master page and the root Master page. My goal now is to fully decouple the ...

Error encountered: jQuery mobile version 1.3.0 - Unable to locate method 'refresh' for the table widget instance

I encountered an issue when using jQuery mobile 1.3.0 release: "Uncaught Error: no such method 'refresh' for table widget instance". However, the documentation suggests that it can be resolved by: Updating the labels in the cells. $(myTable).ta ...

Entity Framework 6.4 causing tables to have duplicate database name references like DatabaseName.DatabaseName.TableName

Issue with Entity Framework causing database name duplication on tables like DatabaseName.DatabaseName.TableName. Despite no duplication in connection string config and web.config, this error is occurring. Has anyone else encountered this issue before? Th ...