"Internet Explorer's filter shadow property is causing text to appear unattractive within the

In Internet Explorer versions 7 and 8, I have implemented a box shadow using the following CSS:

box-shadow:        0px 0px 15px #FF00CC;
-o-box-shadow:     0px 0px 15px #FF00CC;
-moz-box-shadow:   0px 0px 15px #FF00CC;
-webkit-box-shadow:0px 0px 15px #FF00CC;
zoom: 1;
filter: progid:DXImageTransform.Microsoft.Shadow(Color=#ff99eb, Strength=7, Direction=0),
        progid:DXImageTransform.Microsoft.Shadow(Color=#ff99eb, Strength=7, Direction=90),
        progid:DXImageTransform.Microsoft.Shadow(Color=#ff99eb, Strength=7, Direction=180),
        progid:DXImageTransform.Microsoft.Shadow(Color=#ff99eb, Strength=7, Direction=270),
        progid:DXImageTransform.Microsoft.Chroma(Color='#ffffff');
background-color:#FFFFFF;
border:1px solid #FF00CC;

The box shadow effect is being applied successfully, but it is causing the text inside to appear blurred. The black text is losing its crispness as shown in the images above.

I have also included a comparison without the box shadow properties which shows the text looking normal.

Is there a way for me to achieve the box shadow effect while keeping the inside text sharp and clear?

Answer №1

To solve the issue in Internet Explorer 8, you can wrap the content in an additional div with position:relative;, restoring the text's original appearance:

<div class="shadow-box">
    <div style="position:relative;">Lorem ipsum dosectetur adipisicing elit</div>
    </div>

    .shadow-box {
        box-shadow:        0px 0px 15px #FF00CC;
        -o-box-shadow:     0px 0px 15px #FF00CC;
        -moz-box-shadow:   0px 0px 15px #FF00CC;
        -webkit-box-shadow:0px 0px 15px #FF00CC;
        zoom: 1;
        filter: progid:DXImageTransform.Microsoft.Shadow(Color=#ff99eb, Strength=7, Direction=0),
                progid:DXImageTransform.Microsoft.Shadow(Color=#ff99eb, Strength=7, Direction=90),
                progid:DXImageTransform.Microsoft.Shadow(Color=#ff99eb, Strength=7, Direction=180),
                progid:DXImageTransform.Microsoft.Shadow(Color=#ff99eb, Strength=7, Direction=270),
                progid:DXImageTransform.Microsoft.Chroma(Color='#ffffff');
        background-color:#FFFFFF;
        border:1px solid #FF00CC;
    }

However, in Internet Explorer 7, using the shadow filter removes the cleartype property on the font without a known fix.

Credit to CSS Box Shadow and How to simulate CSS3 box-shadow in IE 6-8 without JavaScript..

Answer №2

To achieve the desired effect, simply generate a vacant div with a shadow and then overlay text from another element onto it. This can be accomplished through techniques such as negative margin or absolute positioning.

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

Singling out a particular navigation tab

When attempting to link specific table IDs so that the corresponding tab is active when opened (i.e. www.gohome.com/html#profile), I am facing an issue where the active tab remains unchanged. Even after specifically calling out tab IDs, there seems to be n ...

Vanish and reappear: Javascript block that disappears when clicked and shows up somewhere else

My goal is to make three squares randomly disappear when clicked on the page. However, I am facing an issue where some of them, usually the 2nd or 3rd one, reappear elsewhere on the page after being clicked. I have created a jsfiddle to demonstrate this: ...

What is the best way to use a CSS class in my script specifically for specific screen sizes?

Utilizing bootstrap 4, my code is executing a for loop to generate eight divs with the class "item". To display five items per row, I am using the class "col-2". However, this results in six items being shown in a single row. Since I cannot include the o ...

The Angular Material Theme is not being properly displayed on the mtx-datetimepicker component

Issue: While using directives from ng-matero for DateTime with Angular Material for application design, the dateTimepicker element is not applying the angular material theme as desired. https://i.sstatic.net/zPBp3.png Code Example The app.module.ts file i ...

What is the process for recording a video?

After researching extensively, I am eager to use a plugin that combines jQuery and flash to record a video using the system's Webcam. I came across scriptcam, but unfortunately, I encountered an issue where the plugin hangs on document load and the li ...

Using conditional CSS values in Angular 8

I am currently working on a parent component and child component setup, where I am utilizing the child component's selector to display it within the parent component. Here is my child component's HTML: <div class="main-container" [n ...

Is there a way for my website visitors to seamlessly download the font I use if it's not already installed on their devices?

I've chosen the unique font ff-clifford-eighteen-web-pro-1 for my website. I'm looking to ensure that all text is consistently displayed in this font, even for users who may not have it downloaded on their device. Is there a way to make this hap ...

Enhancing your design with animated borders on hover

This unique border animation caught my eye and sparked my curiosity. I'm interested to know if it can be achieved using only HTML5/CSS for a hover effect. Have you discovered any other visually appealing hover animations worth mentioning? ...

Learn how to cycle through three different texts that appear in the same spot using smooth transitions

I am working with three different rows that contain the Typography component. My goal is to display the first row, followed by the second, then the third, and back to the first one in a continuous loop. All three rows should be shown in the same location, ...

Challenges regarding placement and z-index are causing issues

Currently, I am attempting to make the menu overlap the content on my webpage. However, I am facing an issue where it moves the content box instead of overlapping it. I have already experimented with the position: relative concept, but unfortunately, the ...

Apply scrollbars to a div when its parent div is too small

I am facing an issue where the child div remains fixed in size, even when the parent div is smaller. I need the child div to stay within the parent div and show scrollbars when necessary. Check out the example here Here is the HTML: <div id="parent"&g ...

I'm having trouble adjusting the link color in my footer text while navigating Wordpress for the first time

As someone who is new to Wordpress, I am struggling with changing the link color in the footer text. Despite spending hours on it, I just can't seem to figure it out. The files I have been working with are style.css and bootstrap.min.css. I feel lik ...

When using jQuery, the onChange() function can be used to switch focus

Make sure to check out this fiddle first: http://jsfiddle.net/7Prys/ I am looking for a way to automatically focus on the next input field when a user enters a value in the previous field. This should happen until the fourth input field. Is there a simple ...

What is the best way to adjust the decimal values in my API calls?

Is there a way to adjust the numerical data returned by the API to display only two decimal places instead of three? For example, if the number is 140.444, I want it to show as 140.44 What changes do I need to make? function fetchData() { fetch(" ...

The placement of a material-ui component at the beginning of the render method can impact the styling of the following components in the hierarchy

After creating some styled components, I noticed that they were not rendering correctly for me. However, when I transferred the code to a codesandbox environment (which had a material-ui button in the template), the components rendered perfectly fine. It w ...

Creating a multiline textarea with ellipsis using ReactJS

Looking to create a component with a multiline textfield that displays ellipsis (...) for text overflow beyond 2 lines. How can I achieve this through CSS only without modifying the actual stored text? Utilizing the React component found at: link Appreci ...

Enhance the impact of "dialogs" to the fullest extent or minimize it to achieve the

How can I position the minimized dialog on the bottom of the div when appending dialogs next to each other in a FB messaging system? To achieve a Facebook messaging effect, the titlebar must go down when minimizing/maximizing the dialog. Perform the follo ...

Top tips for resolving Swiper Js initial loading issues in a Carousel!

After implementing swiper js from , I encountered an issue. The initial loading displays only a single carousel item before the rest start appearing, creating a glitchy effect. To clarify, when the website is loaded, only the first item is visible in the ...

Tips for validating user input in AngularJS without using a form tag

Within a popup, I am displaying HTML content that has been copied from another div and shown in the popup. I need to validate this input field to ensure it is required, and display an error message below the input box. <!-- HTML code for changing zip c ...

The content in the div is not contained within a border in the css/html

I am struggling with a div wrapper that has a border, but the border is not wrapping around the content and I can't figure out why. Here is my issue on screen: This is what I want it to look like: Below is my HTML code: <div class="event_area_t ...