Position a button at the top of the screen

I'm currently developing a webapp in .net and utilizing some of the AJAX features, specifically TabContainer. I'm facing an issue with aligning the "Update PCR" button right underneath the "Disciplines Affected" tab on the tab's content side. Since both the left menu and the right content belong to the same block, which is TabContainer, I'm struggling to figure out how to format the CSS for the button placement. Adding the button as part of the menu would require setting the control to AutoPostback, which isn't ideal in this case.

Any suggestions on how to adjust the CSS to position the Button below TabContainer's menu would be greatly appreciated!

EDIT:

Below is the current CSS snippet:

.ajax_tabController .ajax__tab_tab
{
    background-color: #3c6f91;
    padding: 5px;
    border: 1px solid #ffffff;
    color:#ffffff;
    border-left: 3px solid #5AB0DB;
}

.ajax_tabController .ajax__tab_hover .ajax__tab_tab
{
    background-color:#5AB0DB;
    text-decoration:none;
}

.ajax_tabController .ajax__tab_active .ajax__tab_tab
{
    background-color:#5AB0DB;
    text-decoration: underline;
}

Additionally, there's CSS code that modifies the settings to make TabContainer Vertical instead of Horizontal. Although there is a property called .UseVerticalStripPlacement, it disrupts the control's height and triggers a JavaScript error.

.ajax__tab_header
        {
            float: left;
        }
        .ajax__tab_body
        {
            margin-left: 160px;
        }
        .ajax__tab_outer
        {
            display: block !important;
        }
        .ajax__tab_tab
        {
            width: 210px;
            height: auto !important;
        }

Answer №1

Here's a tip that might work for you:

.updatePcrButton {
    position: absolute;
    top: 100px;   /* Adjust these values to align the button properly */
    left: 5px;    
    z-index: 99;  
}

This method is not ideal as it requires specific positioning and may not be very flexible.

Alternatively, you could consider adding an extra tab to the TabContainer and managing tab clicks yourself.

-- Update -- Another suggestion --

I almost forgot about these JavaScript functions from an old Classic ASP project of mine that might be more helpful:

function curTop(obj){
rv = 0;
while(obj) {
    rv += obj.offsetTop;
    obj = obj.offsetParent;
}
return rv;
}
function curLeft(obj){
rv = 0;
while(obj) {
    rv += obj.offsetLeft;
    obj = obj.offsetParent;
}
return rv;
}

These functions retrieve the position of a specified object. Consider factoring in the height of the button for better precision without relying heavily on CSS quirks.

Best regards, [Your Name]

Answer №2

To align the top of the button with the bottom of the tab elements, you can utilize jQuery for this task. For a detailed guide on how to achieve this, please refer to this helpful resource.

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

ASP.NET WebForms Authentication does not truly authenticate the user's login

I'm currently developing a small website on IIS8 using Visual Studio 2015 with ASP.NET 4.5 Webforms and Identity 2.0. My approach has been based on the guidance provided at https://www.asp.net/web-forms/overview/security/create-a-secure-aspnet-web-for ...

Using jQuery, wrap two specific HTML elements together

I am working with a set of elements: <div id="one">ONE</div> <div id="two">TWO</div> <div id="three">THREE</div> <div id="four">FOUR</div> <div id="five">FIVE</div> My goal is to wrap a DIV tag ...

Preventing routevalues from being nulled in Asp.Net Core MVC Html.ActionLink

Struggling with the transition from an Asp.Net MVC 5 project to an Asp Net Core MVC app. The @Html.ActionLink helper isn't behaving as expected during porting. In one of my views, I'm using @Html.ActionLink("Back to " + @action, @action, "Some ...

Solving the issue of .css being blocked due to MIME type while building tailwind is a common problem faced by

https://i.stack.imgur.com/nrDgJ.png While working on my tailwind CSS project, I ran npm run build. However, upon opening the built index.html file, I noticed that the CSS file was not loading properly. How can I resolve this issue? I am unsure of what st ...

Align the CSS dropdown content to the right rather than the left for a cleaner layout

The information in this dropdown menu is currently aligned to the left of the icon. I would like it to be aligned to the right. Thank you! <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="https://use.fontawesome.com/releas ...

When utilizing a script to deliver a true or false response for jQuery's .load() function

Currently, I have found myself delving deep into jquery to manage the ajax requests in my web applications. Specifically, I am working on a bidding system in PHP that heavily relies on mod_rewrite. Using jQuery with a confirm dialog, I send an Ajax request ...

Adjust the height of one div based on the height of another div

I need assistance with creating a dynamic div height based on the content length of another div. For instance, when DIV A contains certain information and DIV B displays feedback related to DIV A. If DIV B has more content than DIV A, I want DIV A to rema ...

PHP and XML encountered a parsing error: unexpected occurrence of the T_OBJECT_OPERATOR

I've been troubleshooting a PHP page that reads data from an XML file. I keep running into this error message: Parse error: parse error, unexpected T_OBJECT_OPERATOR on line 24. I'm unsure of the cause of the error and need help figuring out what ...

Steps to change "open website from folder" to a csproj-structured "ASP.NET Web Application" project

Basically, I have a 'web site' stored in vss that can be opened by going to file, open, web site, and selecting the folder. This method creates a project without a cs/vb proj file. Is there a simple way to convert this to an 'ASP.NET Web Ap ...

The div in JavaScript is expanding properly, but it is not contracting back as expected

I'm experiencing an issue with a div element that I created. My goal is to have it expand when a link is clicked and collapse when the same link is clicked again. At the moment, the div expands correctly but does not collapse as expected. Any assistan ...

Executing an Ajax request to the original page from another controller

Currently, I am utilizing Ajax to send data to a different controller for my application. In this system, users earn points for correctly answering questions. The original view that I'm working with is: app/views/questions/index.html.erb <form ac ...

Tips for choosing an option from a list of options using Selenium with Python

Attempting to select an option from a webpage using Selenium-Python has proven challenging. Despite obtaining the xpath and css selector of the element, all attempts to locate it for clicking have failed. Research indicates that the element may be within a ...

The feature to navigate to a different section on another page is experiencing a malfunction

I'm facing an issue with my navbar setup: <ul class="dropdown-menu" role="menu"> <li><a href="/main_page#top_something">People</a></li> <li><a href="/main_page"&g ...

Java persistence with AJAX technology

Being a beginner in server side development, I am currently working on creating a database application for my company that will store links to all our marketing videos. Each entry consists of a URL (link to video), description, industry, and more. So far, ...

Exploring the Vertical Metrics of Various Typeface Styles

I'm encountering a problem and struggling to find a solution. I'm in the process of creating a website and incorporating various fonts. My goal is to ensure that every font appears visually similar to the others and align perfectly at the base. ...

Switch between display modes using a button and CSS media query

I'm trying to find the most effective method for toggling display states on a webpage using a button while also being able to adjust based on screen size. For larger screens, I want to default to a horizontal layout with the option to switch to vertic ...

Issue with fetching access token from Azure /oauth2/token endpoint using jQuery, Ajax, or AngularJS due to cross-origin restrictions

I am attempting to obtain an access_token from Azure. Error Message: Unable to fetch : No 'Access-Control-Allow-Origin' header is found on the requested resource. Origin 'http://localhost:61697' cannot access it. Code snippet: fun ...

Add CSS file to the HTML head by substituting the <link> tag

Searching for a possible npm-based solution to replace: <link rel='stylesheet' href='style.css'> with <style><!-- actual contents of the style.css file here --></style> to simplify the process of building a l ...

Set the web user control background to be completely transparent

Would appreciate some assistance on how to either remove the background from a web user control or make it transparent, possibly matching the rounded border corners. Any guidance would be greatly appreciated. Thank you in advance! ...

How to Create a Dynamic CSS Mobile Menu Animation

After checking out some online tutorials, I managed to get a hamburger menu working. However, I encountered an issue with the X icon not being symmetrical after the animation from 3 bars to an X. Here is the comparison: Before: https://gyazo.com/351864d8 ...