Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 1 year ago.
Improve this question
When I try to make multiple circles in css and then link them to my html file.
the code looks like this:
.circle{
height: 50px;
width: 50px;
background-color: red;
}
But then when I try to make another circle (by using the same 'circle' class), it interferes with some of my javascript code, some of which are my variables. So I was wondering, if there was a second circle tag that did the same thing.
You have a css class as an example, classes are reusable in your HTML code. For example:
<div class="circle">One circle</div>
<div class="circle">Another circle</div>
Just apply the class to the element either in your JavaScript if you render elements there, or straight up in your HTML as shown above.
On another note, to get rounded edges on your element you can add a border radius in your css class:
.circle{
height: 50px;
width: 50px;
background-color: red;
border-radius: 50%;
}
Create a new div in your HTML, with another class type, f.e. cirlce2
<div class="circle2"></div>
Then just copy paste your CSS:
.circle2{
height: 50px;
width: 50px;
background-color: red;
border-radius: 100%;
}
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
In React on a button click I make a small component (compSmall) visible on top of another big component (compBig). using css properties on compSmall such as
position: absolute;
width: 300px;
height: 150px;
margin-left: 40%;
margin-top: 200px;
border: 1px solid #0083a5;
z-index: 100;
But when compSmall is visible on top of compBig, background (means content of compBig) still visible . But I want content of compBig is to be not visible clear or blur when compSmall is visible.
How to achieve this.
PS:
I can only apply properties on compSmall, not on CompBig. Since CompBig is the whole application component except compSmall.
What about make compSmall with the same size of compBig, so you will not see the compBig and inside the compSmall you can create another component or just a div with those css properties.
JSX
<CompBig>
<CompSmall className="compSmall">
<div className="content"></div>
</CompSmall>
</CompBig>
CSS
.content {
position: absolute;
width: 300px;
height: 150px;
margin-left: 40%;
margin-top: 200px;
border: 1px solid #0083a5;
z-index: 100;
}
.compSmall {
/* Add the blur effect */
filter: blur(8px);
height: 100%;
width: 100%
}
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
I have a div in which, I need to display the div as shown in the image below.
Can we acheive this using css or with any script. Need help
Thanks
Use perspective and transform: rotate.
If you take a look at this link, perspective, you'll find some interesting things one can do
div {
margin-top: 40px;
perspective: 100px;
}
img {
height: 150px;
transform: rotateY(15deg);
}
<div>
<img src="http://lorempixel.com/500/200/nature/1/" alt="">
</div>
This is basic idea.
.parent {
perspective: 600px;
}
.child {
width: 100px;
margin: auto;
height: 35px;
text-align: center;
background: red;
transform: perspective(500px) rotateY(35deg);
}
<div class="parent">
<div class="child">Banners</div>
</div>
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am trying to work on adjusting the size of a picture from a web page.
My friend wrote something, and I am trying to learn from it. What does this code do?
div.page-full-width div#primary div#content div.entry-content div#bbpress-forums div.bbp-reply-form form#new-post fieldset.bbp-form div p.bbp-attachments-form label.btn {
width: 9vw;
height: 1vw;
}
.entry-buddypress-content div#buddypress div.full-width div#item-body div.profile div#subnav {
width: 21vw !important;
height: 8vw !important;
padding-right: 2vw !important;
margin-bottom: 0;
}
#members-stream li .action div.generic-button a, #members-list li .action div.generic-button a {
font-size: 3vw;
line-height: 4vw;
}
some are #, some are . and some are div., how do they work to target specific lines from HTML code?
#foo selects the element with the id foo. (See MDN)
.bar selects all elements with the class bar. (See MDN)
More about CSS selectors in general.
.test is for classes in html
#test is for Ids in html
div. selectes all divs with this classname
Width: 9vw means view width so the image is 9% of the view width
He basically selected with this css a lot of Ids and Classes and gives them a height, width, distance inside(padding), distance outside(margin), font size and the line height(on which height the text should be displayed).
Hope this helps
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
This is a simple 3-column template, with Side-bars on Left and on Right sides and content in the middle. I'm not able to understand the spacing between the columns, there's too much of space between the content(post) column and right side-bar.
[side-bar] [content/ post / matter]_____space/gap___[side-bar]
I'm not able to reduce/remove the '_space/gap ' to make the template look like
[side-bar] [content/ post / matter] [side-bar]
Before posting this here, I've tried chrome-developer tool to know and refactor it, I've not been able to understand it.
JSFiddle Example
Change this section of your code:
#right {
float: right;
width: 180px;
padding: 10px 30px 10px 0;
}
to this:
#right {
float: left;
width: 180px;
margin-left: 10px;
padding: 10px 30px 10px 0;
}
Floating right will hold that container to the rightmost position it can attain within its own container.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have 3 rectangles that I've created with CSS. I want them to be clickable and link them to a file called "index.html". I've been searching over the web but could not find a way to do it. Is there also a way where hovering your mouse over the rectangle would just have the index.html file pop up but not open in a completely new window? Here is a snippet of what I have so far:
.rec
{
height: 100px;
width: 125px;
}
#d1
{
background : lightgreen;
border: 2px solid black;
display: inline-block;
left: 0%;
}
#r1
{
background : red;
border: 2px solid black;
display: inline-block;
left: 10%; position: relative;
}
#r3
{
background : white;
border: 2px solid black;
display: inline-block;
left: 20%; position: relative;
}
You should see JavaScript and jQuery tutorials. It's what, mostly, makes web pages interactive. Although in here, the best solution is clearly to use
<a href="index.html">
it would be good for you to learn them, and their incredible power. Check this fiddle here: http://jsfiddle.net/qjntjyyr/
As you can see, it's quite simple. In the next fiddle, I'm using an event for when the mouse goes over the squares.
http://jsfiddle.net/qjntjyyr/1/
Have fun with it, you can manipulate almost everything you want.
The clickable rectangles:
Index
Index
Index
As for the little box that appears when you hover them, you could use a title="" in the anchor tag, but that has the default styling the OS gives it. To customize one yourself you'd need JavaScript.
I found an interesting link to learn for your problem:css-trick
But the first answer is a good one to use.