The border appears unnecessarily when clicking on the content area of the Understrap theme

Currently, I am in the process of building a WordPress theme using Understrap and its customstrap child theme from livecanvas. This project involves utilizing Bootstrap 4.

I have successfully developed my theme, however, I am encountering an issue where an unnecessary border appears when clicking on the content area within the theme. Despite inspecting the code via the browser tools, I have been unable to pinpoint the source of this problem.

If you are interested, you can access the Understrap repository here: https://github.com/understrap/understrap

Additionally, below is a snippet from my page.php file:

<?php
/**
 * The template for displaying all pages
 *
 * This is the template that displays all pages by default.
 * Please note that this is the WordPress construct of pages
 * and that other 'pages' on your WordPress site will use a
 * different template.
 *
 * @package understrap
 */

// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;

get_header();

$container = get_theme_mod( 'understrap_container_type' );

?>

<div class="wrapper" id="page-wrapper">

    <div class="<?php echo esc_attr( $container ); ?>" id="content" tabindex="-1">

        <div class="row">

            <!-- Do the left sidebar check -->
            <?php get_template_part( 'global-templates/left-sidebar-check' ); ?>

            <main class="site-main" id="main">

                <?php
                while ( have_posts() ) {
                    the_post();
                    get_template_part( 'loop-templates/content', 'page' );


                }
                ?>

            </main><!-- #main -->

            <!-- Do the right sidebar check -->
            <?php get_template_part( 'global-templates/right-sidebar-check' ); ?>

        </div><!-- .row -->

    </div><!-- #content -->

</div><!-- #page-wrapper -->

<?php
get_footer();

Can anyone suggest which selector I should use to address this issue?

Please refer to the images below for visual representation:

1st image: Default appearance

2nd image: Appearance when the content area is clicked

https://i.sstatic.net/sxpyc.png https://i.sstatic.net/sx9q5.png

Encountering the border issue upon clicking the content area.

Answer №1

I believe the solution lies within the outline property in CSS.

Unfortunately, without being able to view your code at the moment, I recommend trying this snippet in your styles for debugging purposes:

* {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

Answer №2

Consider the code snippet below where the attribute tabindex is employed for enhancing keyboard navigation. The pseudo-class :focus comes into play when using the tabindex.

<div class="<?php echo esc_attr( $container ); ?>" id="content" tabindex="-1">

The div mentioned above with an id of content, allowing you to specifically remove the outline by applying this CSS rule:

#content { outline: none !important; }
.

Avoid utilizing asterisks with :focus, such as *:focus, as it may unintentionally affect other styles besides removing the outline.

Answer №3

After inserting the following code in the custom CSS section of WordPress:

*:focus{outline: none !important;}

I noticed it functions correctly.

However, I am puzzled as to why it fails to work when placed in the style.css file.

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

"Create a dynamic HTML newsletter utilizing tables similar to the responsive design principles

Looking to create a mobile-responsive newsletter using my style.css <table cellpadding="0" cellspacing="0" border="0" align="center" width="600" bgcolor="#fff"> <tbody> <tr> <td style="padding-bottom:5px" valign="top"&g ...

When trying to show a Vue view, there was an issue with reading properties of null, specifically the 'style' property

I am experiencing an issue with a header that has an @click event in the body. Instead of displaying a Vue view upon clicking, I am encountering the following error: Cannot read properties of null (reading 'style') Upon researching on Stack Ove ...

What is the best way to center numbers in a table cell while aligning them to the right?

In a table, I want to display numbers centered in a column but right-aligned as well. To achieve this: table { border: 1px solid black; } th { width: 200px; } td { text-align: center; } <table> <thead> <tr> <th& ...

A guide on dynamically adjusting text size based on viewport width and height in React with TailwindCSS

Utilizing React and Tailwind, I am working towards creating two overlapping rectangles with text. The top rectangle's text should be aligned to the left, while the bottom rectangle's text should be aligned to the right. Regardless of window size ...

Toggle the visibility of elements based on radio button selection, and dynamically insert new elements

I am facing an issue with JavaScript and jQuery. Below is how my code appears in the browser. https://i.sstatic.net/nImxS.jpg When "New Question" is selected, I want to display <div class="new"> and hide <div class="existing">. Conversely, w ...

best method for embedding javascript code within html (within a script tag)

In my quest to create dynamic HTML using jQuery and insert it into a specific div on my website, I encountered an issue. Specifically, I am attempting to generate an anchor element where both the href and label are determined by JavaScript variables. Here ...

Python for HTML to PDF Conversion

I have been struggling to convert HTML into a PDF document using Django without any success. Initially, I attempted to utilize wkhtmltopdf 0.9.9, but Apache returned an error stating that wkhtmltopdf could not connect to the server. Surprisingly, when I u ...

Media queries in JavaScript allow developers to adjust the styling

I'm facing an issue with reducing the size of a cube on smaller screens using media queries. I have implemented media queries in JavaScript because my cube size is defined in JS. However, the cube size remains the same even when I resize the browser w ...

The Nodejs express static directory is failing to serve certain files

Hello everyone, I'm currently working on a project using NodeJs, Express, and AngularJS. I've encountered an issue where my page is unable to locate certain JavaScript and CSS files in the public static folder, resulting in a 404 error. Strangely ...

Changing the class of an element in Svelte: A step-by-step guide

I am working on a svelte application and I want to implement row highlighting when a user clicks on it. Here is an example code snippet that demonstrates this functionality: <div id="A" class="car-even">A</div> <div id=&q ...

bootstrap 4 appears to encounter some responsiveness issues when it comes to rendering on iPhone

https://i.sstatic.net/rdOtX.png While inspecting my website on mobile using developer tools, everything looks perfect. However, when I view it on my actual iPhone 6, the layout seems off. Could this be a bug specific to the iPhone 6? Here are my meta tag ...

Implementing dynamic CSS class addition on CodeIgniter web pages

Exploring the templating mechanism I use in my CodeIgniter application: public function index($page = 'login') { $this->load->view('admin/header',array('page'=>$page)); $this->load->view(&a ...

The dropdown UL element loses its opacity in Internet Explorer

After creating a basic CSS dropdown menu, I encountered a strange issue when viewing it in IE. In the screenshot provided, only the shadow is visible and the content inside the element appears to be transparent. I have not utilized transparency anywhere o ...

Empty Ajax Response Detected

Here is the form I am working with: <div class="any_reg"> <div class="mail_area"> <form name="any_reg" id="any_reg" method="POST" action="" class="mail_area"> <table> < ...

The images in Bootstrap 5 are displayed individually on separate lines, even though they could easily be accommodated within a

I'm facing an issue with displaying several 50x50 images in a row of 6 columns on my website. Despite the simple code setup, each image appears on its own row, creating the illusion of stacked images rather than a single row. This is the code structu ...

Utilizing AJAX to call an HTML file that incorporates JavaScript and CSS components

Currently, I am incorporating AJAX to fetch an HTML file that contains jQuery and JavaScript. Despite already including these scripts on the page, the JavaScript (and CSS) are not running as expected. Any suggestions on how to make my JavaScript function ...

Having difficulty with jquery ui resizable() functionality not functioning as expected

Check out the jsFiddle here The HTML code snippet: <div class="empty ui-widget-content"> <div class="settings-menu"> </div> </div> The CSS code snippet: .empty { height: 50px; display: block; float: left; ...

Press the identical button arrangement with selenium using python

How do I click on buttons with the same classes one by one? This is the Python code I am using: clk_but1 = wait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//button[@class = ('applyBtn btn btn-sm btn-red')]"))) driver.execute_s ...

sequentially animating elements using animate css in a choreographed manner

I have created a unique jsfiddle with 20 boxes that I am trying to animate using the Animate.css plugin. The plugin can be found at daneden.me/animate. My goal is to animate each box one after the other in a sequential manner, but I seem to be having trou ...

Upon loading the page, there is a sudden downward movement

I've been struggling with this issue for some time now. After the page finishes loading or is nearly done, it suddenly jumps down about halfway. What I'm hoping for and what I would expect is that the page stays at the top once loaded. Could so ...