Is it possible to create this design using CSS?
Is it possible to create this design using CSS?
If you're looking to create a unique design, you might want to give this a try: https://jsfiddle.net/dqhx5cf5/
Here's the code snippet:
<div class="rectangle"><div class="circle"></div></div>
And here's the CSS for it:
.rectangle{
background-color: darkblue;
width: 300px;
height: 500px;
overflow:hidden;
}
.circle{
border-radius: 50%;
width: 600px;
height: 600px;
background-color: #ddd;
position:relative;
left: -150px;
top: 100px;
border: 2px dashed darkblue;
box-shadow: 0 0 0px 5px #ddd;
}
Note that in Firefox, the dashed line may not appear as intended due to compatibility issues. However, it should display correctly in IE and Chrome.
Creating a unique shape can be done using the following code:
.custom-shape {
background-color: #f4f4f4;
border-radius: 50% 50% 0 0;
bottom: 0;
height: 120px;
position: absolute;
width: 60px;
}
.container {
background-color: #6d9eeb;
height: 150px;
position: relative;
width: 60px;
}
<div class="container">
<div class="custom-shape"></div>
</div>
To learn more about creating unique shapes, visit this link
Here is the solution to your question. I trust it will be beneficial for you.
Thank you
*{margin:0;}
.container{width:400px;border:2px solid #666; height:400px;}
.main{background:#666; width:100%; height:200px; position:relative;overflow:hidden;}
.oval{background:#fff;width:100%;height:200px;position:absolute;bottom:-100px;border-radius:50%;}
.oval-dashed{background:#fff;width:100%;height:200px;position:absolute;bottom:-110px;border-radius:50%; border:1px dotted #666}
<div class="container">
<div class="main">
<div class="oval"></div>
<div class="oval-dashed"></div>
</div>
</div>
To ensure it adjusts to the width of the container (in this case, the body):
Check out this example on JSFiddle
HTML code:
<div class="elliptical-container">
<h1>Content</h1>
</div>
CSS styling:
.elliptical-container {
margin-top: 100px;
box-sizing: border-box;
height: 100%;
background: #EEEDEE;
border-top-left-radius: 50% 75px;
border-top-right-radius: 50% 75px;
box-shadow: 0 0 0 4px #EEEDEE;
border-top: 1px dashed #3B2053;
}
I created a simple program that searches for a value within a div and displays the first location of the word. However, I am looking to enhance it by highlighting all repeated locations of the searched word after pressing the search button. <html> & ...
Seeking out a solution for a sticky footer that adjusts its height based on the width of the browser. Creating sticky footers in flexible designs can be tricky. I've come across various suggestions, discussions, and fixes for implementing sticky foot ...
I have created a div containing a triangle shape as shown below: #inner-div { width:200px; height:200px; background-color:black; position:relative; border:2px solid red; } #triangle { border-right:15px solid transparent; border-left:15px s ...
Is there a way to create a website with a textbox and save button, where entering a link saves the entire website like the 'save page' feature in Google Chrome? Can this be done using PHP or HTML? And is it possible to zip the site before downloa ...
I have been utilizing the Bootstrap WYSIWYG rich text editor to create HTML email templates. The editor functions perfectly when checked in the browser. To fetch the HTML contents of the editor div using JQuery, I used $("#editor").html(); In an attempt ...
I can't figure out why my jQuery slider doesn't stop right away after a mouseover event. There seems to be a delay that I can't resolve on my own. Can someone lend a hand with this problem? Here is the code I'm working with: https://js ...
In my search.html file, I have set up a form where users can input their search criteria and click the search button to find information within a database of 1000 records. The HTML part is complete, but I am unsure how to create the action link for the for ...
I have developed an Angular application that utilizes ASP.Net Core as a backend and incorporates bootstrap 4 and ngx-bootstrap for styling. Strangely, I am encountering an issue where the ID's on all my HTML <label> tags are not being recognize ...
Currently, I am attempting to customize the appearance of my web data grid by changing its CSS, particularly focusing on altering the color of the header and rows. So far, my search for solutions has led me to two common suggestions: Edit the Infragist ...
I am in the process of creating a website that features a consistent design element of an inset border surrounding a block of content within a <div>. This inset border is achieved using LESS/CSS, and is contained within a separate <div class="inse ...
The form-control-feedback class doesn't appear to be included in Bootstrap 4. What is the most effective way to achieve the desired outcome (an icon inside the textbox) using Bootstrap 4? <head> <link rel="stylesheet" href="https://max ...
I am searching for a way to automatically compress classes and ids in an .html file. This specific file is generated through a sequence of gulp commands. I attempted to use the Munch command line application, but it had adverse effects on the file by elimi ...
Check out this link: http://jsfiddle.net/zCXMv/18/ I'm having trouble getting this to work properly. Any assistance would be greatly appreciated. Here is the HTML code snippet: <div id="button" > <a class="button1 active" rel="1">&l ...
My current project involves creating a simple web page template using HTML/CSS. I followed a tutorial to implement the navigation code. However, at 769px, the layout breaks, causing the page to not be full width and hidden. Here is what happens: Here&ap ...
I am struggling to align an inline SVG within a bounding DIV correctly, as shown in this example. <!DOCTYPE html> <html> <body> <div style="border: 1px solid black; height: 50px; width: 100px; vertical-align:top;"> < ...
Encountered a strange issue with the fixed header on my website under specific conditions: Using an iPhone 6+ in landscape mode. Using Safari with at least two tabs opened. The page has a fixed position header with html and body set to position: relative ...
Having some trouble with a code for image zoom in/out. When I adjust the position of the image by applying margin left to either the image or the image container (#view), it affects the zoom functionality - causing the image to move to the left during zoom ...
I'm currently working on designing a slim right-facing arrow using CSS. So far, I've successfully created the circular div, but I'm struggling with creating the arrow itself. <div class="circleBase type2"></div> I've set ...
After streamlining my project to focus on the main issue, I am still facing a problem. Here is the relevant code snippet: .App{ background-color: aqua; } .AboutMe{ color:blue; background-color: yellow; } This is from App.js: import logo from '. ...
Hey there, I'm feeling a bit inexperienced with this question, so after struggling on my own for a while I decided to turn to stackoverflow for help. So, I have a website located at , and at the very bottom of the page there's some copyright inf ...