I am currently working on the survey form challenge to complete my HTML and CSS course. Nothing seems to be going right. There are whole swatches of code that the computer, (or whatever reads the code and runs it on CodePen), isn’t running. I am getting very frustrated. I think that I’m losing my sanity. Let me list some things out for you:
The box in the middle of the page that holds the form is not centered and is twice the width that I need/ want it to be.
The box that holds the form info is replicating the background image inside it. I need for the box to be a solid color.
I’m scared that the background image will be completely covered by the box and no one will be able to see it.
I have the right code for the test, but there is no test box, like CodePen is unable to run that code, so the tests don’t exist.
There are a couple other things that are bothering me, but I can’t recall exactly what they are right now. All I know is that this whole thing is becoming more and more frustrating. On top of this, there are evidently still some things that are wrong with my tribute page which I have to fix. Also, for all those who wish to know, I never received a validation email from CodePen, and I don’t know how to ask them for another one. (Sorry for my little rant. I needed it.
@nhcarrigan
Kinda, lot closer than what I had.
More like the image should take up the entire page, I have no clue where all that white is coming from.
The box should be centered in the image.
What did you do to get the forum info centered? and the box black???
Tell me your secrets! I am but a novice.
@Spyhere What is that and how does it work? (you can just send me a link to an article that explains it if you want).
VS is very powerful. Also search about development tool in chrome, there you will be able to debug even js and react projects. So it will save you hundreds of hours.
Keep your project files in folder.
Also you can click on the project folder with right click and choose “Open with VS” - this is just a small lifehack for you))
If that doesn’t work you jacked up your margins/padding and they’re exceeding the space on the screen somehow. There is no fixed math with that, but start with “margin: 0; padding: 0;” and apply it to the * CSS tag. Adjust it after that until it looks right. Make sure you’re using: “box-sizing: border-box;” as well so you are having accurate element sizes.
Fixing the background, use:
background: url(‘https:\\wherever/it/is.jpg’) no-repeat center center/cover;
Set a different background color for the “form” tag, you can set the opacity property to make it slightly see-through. You would have to use rgba color rather than hex or anything else or it’ll make the text transparent too, lol. Just remember “opacity” affects all the text/background and “background-color: rgba(10,10,10,0.7);” would only affect the background color not the text. (probably what you want…)
For the test box you gotta add the “script” tags from the project spec to the bottom of your code right before the end “body” tag.
You will have to manually set widths on the elements if you want to control them. The other way is add padding to them and control the width of their containers until they look right. (There is often more than one way to do things in CSS.)
P.S. - Don’t mix “flex” alignments with “text-align”.