Align watermark content to the far left side

Having trouble getting my watermark to align properly on the left side of my website's main content. Here is how it currently looks: https://i.sstatic.net/Nfhh5.png

The issue arises when I resize the screen or switch to mobile view, as the watermark ends up covering the main content. My goal is to have the watermark flush against the far left side of the screen and either disappear or not obstruct the main content when the screen size shrinks.

This is the code that I wrote:

<div id="background">
    <p id="bg-text">Add watermark here.</p>
</div>
//CSS:
#background{
  position:fixed;
  z-index: 100000;
  background:white;
  top: 400px;
  left: 0px;
}

#bg-text
{
    color:lightgrey;
    font-size:10px;
    transform:rotate(-90deg);
    -webkit-transform:rotate(-90deg);
}

Struggling to understand why this is interfering with the main content. It's supposed to be a subtle watermark that only appears when necessary.

Answer №1

If you want your website to adapt to different screen sizes, you'll need to utilize the power of media queries. By establishing breakpoints for various devices and incorporating specific CSS rules for each breakpoint, you can control how your website responds to different screen sizes.

Learn more about Responsive Web Design with Media Queries here!

Discover how to target desktop, tablet, and mobile devices using media queries. (Check out the discussions and solutions provided in the comments)

Answer №2

If you want to hide a div on mobile and display it on medium screen resolutions, you can achieve this using Bootstrap breakpoints and display utility classes. Take a look at the following resource for more information: https://getbootstrap.com/docs/4.0/utilities/display/

Implement these display utility classes in your code. Using d-none will ensure the div is hidden on mobile devices, while the class d-md-block will show the div on screens that are medium-sized or larger.

<div id="bg-text" class="d-none d-md-block">
    Add watermark here.
</div>

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

Pictures may become distorted when their width is smaller than the container

In my current project, I am facing an issue with maintaining the aspect ratios of images of different sizes. Most of them are looking good except for those whose width is smaller than the container's width of 285px. Even though some blurriness is acce ...

Passing a variable from a jQuery function to a submitted form: the ultimate guide

I stumbled upon this code snippet online and it's exactly what I needed to learn from as a beginner using jQuery. However, I have a question about transferring or passing the value of counter that was used in the jQuery script within the HTML head tag ...

Guide to adding a Favicon Icon to a Next Js 13 App Router

Is it possible to update the favicon icon in Nextjs 13 by utilizing the app router for routing? ...

Is it possible to link actions to a storage location external to a component?

Imagine having a store set up with a middleware called redux-thunk. The store is created and exported using the following code: import myOwnCreateStoreMethod from './redux/createStore'; export const store = myOwnCreateStoreMethod(); Now, you ha ...

What is preventing my function from retrieving user input from an ngForm?

I'm currently working on my angular component's class. I am attempting to gather user input from a form and create an array of words from that input. The "data" parameter in my submit function is the 'value' attribute of the ngForm. Fo ...

Discovering the positions of HTML elements rendered with WebKit (or Gecko) technology

I am seeking a way to retrieve the dimensions (coordinates) of all HTML elements on a webpage as they appear in a browser, including their rendered positions. Specifically, I need to obtain values like (top-left, top-right, bottom-left, bottom-right) Afte ...

No validation errors coming from the Laravel controller when using React and Inertia

I am attempting to receive validation errors in a React component when a form is empty, but I am not getting any validation errors. This function is called when the form is submitted: `const handleSubmit = (e) => { e.preventDefault() const formData = n ...

Exploring StickIt: Binding the length property from a backbone.Collection

Exploring the use of Backbone, Marionette (1.8.3), StickIt, and TypeScript to effectively bind the length of a Backbone collection in real-time as items are added or removed. As someone new to StickIt, here's my current attempt: export class SomeVie ...

The feature of option display is not supported on Safari browser

I am facing an issue with the functionality of two dropdown menus. The options in the second dropdown are supposed to be shown based on the selection made in the first dropdown. While this feature works perfectly in Chrome, it seems to be malfunctioning i ...

The website's responsiveness appears to be malfunctioning on iPhone 10 and other iOS devices

I have implemented the code below for redirecting my website in an iframe, and it displays perfectly on all browsers except Safari on iPhone. I have tested it on various models of iPhones. <head> <title>My Website</title> <meta name=" ...

Whenever I adjust the zoom on my HTML page, it either scrolls upwards or downwards

Is there a way to prevent the page from scrolling when using zoom-in or zoom-out? I attempted using overflow: hidden in the body, but it did not work. <!DOCTYPE html> <html lang="en"> <head> <meta charset=&q ...

What is the best approach to effectively handle React and other dependencies in a structured manner?

Context Struggling to configure my AirBnB linting, I made the decision to uninstall all npm packages for a fresh start with my package.json file. Actions Taken I executed the following bash commands: npm uninstall `ls -1 node_modules | tr '/&bsol ...

UI experiencing issues with selecting radio buttons

When trying to select a radio button, I am facing an issue where they are not appearing on the UI. Although the buttons can be clicked, triggering a function on click, the selected option is not displayed visually. <div data-ng-repeat="flagInfo in avai ...

Troubleshooting Bootstrap select box design discrepancies

Currently revamping a website and encountered an unusual issue with select boxes. There seems to be an overlapping white space where the option values should be. Here's a visual reference: View Image of Select Box Issue Utilizing Bootstrap for the re ...

Guide to Returning a Unique Error Message when Verifying Credentials with Next-Auth v5.0.0-beta.5

Currently, in my nextJs app, I am using [email protected] for user authentication. I am looking to implement custom error handling for failed user authentication with credentials. In the past, I was able to achieve this functionality with the followi ...

``on click of the back button of the browser, automatically submit the form

I'm facing a specific issue that I need help with. I have created a form with a hidden value, and I want it to be submitted when the user clicks the browser's back button. Although I've managed to control the backspace key, I haven't be ...

Has jQuery UI Accordion taken over the design of unordered lists?

I'm having trouble with my website's navigation styling getting messed up by the jQuery accordion. The unordered list inside the .accordion div is overflowing and losing its CSS styling. I've tried adding clearStyle true and autoHeight false ...

Angular fixes corrupted Excel files

My current project involves using Angular to call an API and retrieve a byte[] of an Excel file. However, I am facing issues with the file becoming corrupted when I convert the byte[] to a file using blob. Can anyone offer assistance with this problem? M ...

"Interactive bootstrap tabs nested within a dropdown menu that automatically close upon being clicked

Hey, I've got a dropdown with tabs inside. When I click on certain tabs within it, they close but the content inside the tabs that I click on changes, so it's functioning properly. However, the issue is that it closes when I want it to stay open ...

Is it possible to generate a separate table for each user using PHP?

Embarking on a new adventure, I have chosen to create an online shopping website for a college project. My roadblock comes at the sign-up stage. I envisioned users having separate tables to store products they add to their carts, allowing them to add more ...