-
Apr 13th, 2018, 03:02 PM
#1
[RESOLVED] css help
Q1/ I have 4 html sections with id sectiona, sectionb, sectionc, sectiond. 3 of these sections, i want to set the width to 305px, and centre in the webpage. sectiond, i want to set the width to 700px, and centre in the webpage. What is wrong with this css?
section {
width: 305px;
}
#sectiond {
width: 700px;
}
section {
margin-left: auto;
margin-right: auto;
}
Q2/ I have several submit buttons with a class name form-submit. Again my css doesn't work...
.form-submit {
background-color: chartreuse;
-webkit-border-radius: 5px;
border-radius: 5px;
}
.form-submit:hover {
background-color: yellow;
-webkit-border-radius: 5px;
border-radius: 5px;
}
I'm testing in chrome, but i can't give you the url for testing.
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Apr 13th, 2018, 03:10 PM
#2
Re: css help
so you want a class for sectiona,b,c
which means you're missing the dot . in front of section {
then each div must have class="section"
-
Apr 13th, 2018, 03:15 PM
#3
Re: css help
section {
}
Uses the element tag as the selector
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Apr 13th, 2018, 03:19 PM
#4
Re: css help
The section elements all display centred at 305px width. By putting the sectiond code after the general section code, i expected it to 'cascade'
Am i going crazy or is this just a caching error on the server?
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Apr 13th, 2018, 04:38 PM
#5
Re: css help
interesting, are you using a reset?
-
Apr 13th, 2018, 04:52 PM
#6
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Apr 13th, 2018, 06:52 PM
#7
Re: css help
Originally Posted by DEXWERX
interesting, are you using a reset?
It was just a cache error.
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Apr 16th, 2018, 03:14 AM
#8
Re: css help
The cascade in CSS works maybe slightly different than your expecting.
.Section - the . indicates a class
#Section - the # indicates the ID of specific item
they both apply independently of each other, with the Id overriding the Class style as its more specific
The cascade works on your other example, you should be able to change this
Code:
.form-submit {
background-color: chartreuse;
-webkit-border-radius: 5px;
border-radius: 5px;
}
.form-submit:hover {
background-color: yellow;
-webkit-border-radius: 5px;
border-radius: 5px;
}
to this
Code:
.form-submit {
background-color: chartreuse;
-webkit-border-radius: 5px;
border-radius: 5px;
}
.form-submit:hover {
background-color: yellow;
}
the original form-submit class still applies to the item and so in the Hover you just need to add what you want to change
Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you
-
Apr 16th, 2018, 04:17 AM
#9
Re: css help
I was right after all of that. Clearing the cache and rebooting was the answer.
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Apr 16th, 2018, 07:41 AM
#10
Re: [RESOLVED] css help
cool. in case you're wondering what a reset is, just google css reset.
They normalizes css differences between browsers. They are typically included with any framework css, or if you're not using a framework you can use a reset on its own.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|