Jump to content

Basic Web Dev question(s)

c0d0ps
Go to solution Solved by LukeTim,

So you give a div a class then within the class, you write the required amount classes?

 

You simply include the names of all the classes you want in the class attribute of the div, separated by spaces.

<div class="a_class another_class"></div>

Q. How do you write several classes at the same time?

A. You give a div a class then include all the classes you want in the "class" attribute of the div, separated by spaces. 

Ex. <div class=" foo bar aaa "></div>

Edit: This is one of the many questions I have in homework.

 

Q 2. What does the attribute Title do?

A. It defines a title, and some information which you can look at while the site loads ..?

 

Q 3. What's wrong with the following code?

<img alt="blomma" title="blomma" src="b.jpg />?

A. Alt and title can't be the same thing since it's like alt not even being there. Alt isn't contributing with anything.

 

Are the answers I have written/gotten correct?

I am translating this from Swedish.

PC  Specs 2022:

Spoiler
  • CPU
    AMD Ryzen R9 5900x @ 5.1GHz - Auto OC
  • Curve Optimizer Magnitude: -20
  • Motherboard
    ASUS ROG STRIX x570-F Gaming
  • RAM
                                        Kingston Fury 32GB DDR4 3200MHz 16x2GB
  • GPU
    MSI 3070 8GB Ventus 2x OC
  • Case
    LIAN LI LANCOOL MESH II Mesh RGB Black
  • Storage
    Kingston NV1 2TB M.2. NVMe
  • PSU
    Seasonic Focus GX 850w 
  • Display(s)
    MSI OPTIX MAG 251RX IPS 240hz & ASUS MG248Q Vertical 144hz & Dell 60hz
  • Cooling
    NZXT Kraken x73 360mm
  • Keyboard
    Tt eSports Meka G1
  • Mouse
    Logitech G Pro Wireless
  • Operating System
    -Windows 10 Professional 64bit
Link to comment
Share on other sites

Link to post
Share on other sites

Won't writing one by one be better and more efficient ? 

  ﷲ   Muslim Member  ﷲ

KennyS and ScreaM are my role models in CSGO.

CPU: i3-4130 Motherboard: Gigabyte H81M-S2PH RAM: 8GB Kingston hyperx fury HDD: WD caviar black 1TB GPU: MSI 750TI twin frozr II Case: Aerocool Xpredator X3 PSU: Corsair RM650

Link to comment
Share on other sites

Link to post
Share on other sites

Not sure what you mean, you can just give divs classes

 

<div class='whatever'>

stuff

</div>

 

So that you can easily style with CSS or whatever later

 

.whatever {

     color: '#fffff';

}

Link to comment
Share on other sites

Link to post
Share on other sites

Won't writing one by one be better and more efficient ? 

 

I have this question for homework and several others.

But yes it's a weird question.

Not sure what you mean, you can just give divs classes

 

<div class='whatever'>

stuff

</div>

 

So that you can easily style with CSS or whatever later

 

.whatever {

     color: '#fffff';

}

So you write several Divs and then classes within the divs?

Can I only do 1 class within 1 div?

PC  Specs 2022:

Spoiler
  • CPU
    AMD Ryzen R9 5900x @ 5.1GHz - Auto OC
  • Curve Optimizer Magnitude: -20
  • Motherboard
    ASUS ROG STRIX x570-F Gaming
  • RAM
                                        Kingston Fury 32GB DDR4 3200MHz 16x2GB
  • GPU
    MSI 3070 8GB Ventus 2x OC
  • Case
    LIAN LI LANCOOL MESH II Mesh RGB Black
  • Storage
    Kingston NV1 2TB M.2. NVMe
  • PSU
    Seasonic Focus GX 850w 
  • Display(s)
    MSI OPTIX MAG 251RX IPS 240hz & ASUS MG248Q Vertical 144hz & Dell 60hz
  • Cooling
    NZXT Kraken x73 360mm
  • Keyboard
    Tt eSports Meka G1
  • Mouse
    Logitech G Pro Wireless
  • Operating System
    -Windows 10 Professional 64bit
Link to comment
Share on other sites

Link to post
Share on other sites

I have this question for homework and several others.

So you write several Divs and then classes within the divs?

Can I only do 1 class within 1 div?

You can nest Divs with classes like so

 

<div ='div1'>

      <div='nested_div'>

     

      </div>

</div>

Link to comment
Share on other sites

Link to post
Share on other sites

You can nest Divs with classes like so

 

<div ='div1'>

      <div='nested_div'>

     

      </div>

</div>

So that is an almost yes?

I am confused.

PC  Specs 2022:

Spoiler
  • CPU
    AMD Ryzen R9 5900x @ 5.1GHz - Auto OC
  • Curve Optimizer Magnitude: -20
  • Motherboard
    ASUS ROG STRIX x570-F Gaming
  • RAM
                                        Kingston Fury 32GB DDR4 3200MHz 16x2GB
  • GPU
    MSI 3070 8GB Ventus 2x OC
  • Case
    LIAN LI LANCOOL MESH II Mesh RGB Black
  • Storage
    Kingston NV1 2TB M.2. NVMe
  • PSU
    Seasonic Focus GX 850w 
  • Display(s)
    MSI OPTIX MAG 251RX IPS 240hz & ASUS MG248Q Vertical 144hz & Dell 60hz
  • Cooling
    NZXT Kraken x73 360mm
  • Keyboard
    Tt eSports Meka G1
  • Mouse
    Logitech G Pro Wireless
  • Operating System
    -Windows 10 Professional 64bit
Link to comment
Share on other sites

Link to post
Share on other sites

So that is an almost yes?

I am confused.

Yes you can put multiple divs inside each other.

 

Oh, in multiple classes in a single div, I don't think so, let me test it.

 

Idk, it let me do <div class='1' class='2'> but I'm not sure what that does

Link to comment
Share on other sites

Link to post
Share on other sites

This is what you want to do:

<div class="class_1 class_2 class_3 ..."></div>
.class_1 {}.class_2 {}.class_3 {}...

You can add classes ad infinitum

Link to comment
Share on other sites

Link to post
Share on other sites

 

This is what you want to do:

<div class="class_1 class_2 class_3"></div>
.class_1 {}.class_2 {}.class_3 {}

So you give a div a class then within the class, you write the required amount classes?

PC  Specs 2022:

Spoiler
  • CPU
    AMD Ryzen R9 5900x @ 5.1GHz - Auto OC
  • Curve Optimizer Magnitude: -20
  • Motherboard
    ASUS ROG STRIX x570-F Gaming
  • RAM
                                        Kingston Fury 32GB DDR4 3200MHz 16x2GB
  • GPU
    MSI 3070 8GB Ventus 2x OC
  • Case
    LIAN LI LANCOOL MESH II Mesh RGB Black
  • Storage
    Kingston NV1 2TB M.2. NVMe
  • PSU
    Seasonic Focus GX 850w 
  • Display(s)
    MSI OPTIX MAG 251RX IPS 240hz & ASUS MG248Q Vertical 144hz & Dell 60hz
  • Cooling
    NZXT Kraken x73 360mm
  • Keyboard
    Tt eSports Meka G1
  • Mouse
    Logitech G Pro Wireless
  • Operating System
    -Windows 10 Professional 64bit
Link to comment
Share on other sites

Link to post
Share on other sites

So you give a div a class then within the class, you write the required amount classes?

 

You simply include the names of all the classes you want in the class attribute of the div, separated by spaces.

<div class="a_class another_class"></div>
Link to comment
Share on other sites

Link to post
Share on other sites

 

You simply include the names of all the classes you want in the class attribute of the div, separated by spaces.

<div class="a_class another_class"></div>

Ok, I think I understand.

Do you know how to answer the other questions too? :-)

PC  Specs 2022:

Spoiler
  • CPU
    AMD Ryzen R9 5900x @ 5.1GHz - Auto OC
  • Curve Optimizer Magnitude: -20
  • Motherboard
    ASUS ROG STRIX x570-F Gaming
  • RAM
                                        Kingston Fury 32GB DDR4 3200MHz 16x2GB
  • GPU
    MSI 3070 8GB Ventus 2x OC
  • Case
    LIAN LI LANCOOL MESH II Mesh RGB Black
  • Storage
    Kingston NV1 2TB M.2. NVMe
  • PSU
    Seasonic Focus GX 850w 
  • Display(s)
    MSI OPTIX MAG 251RX IPS 240hz & ASUS MG248Q Vertical 144hz & Dell 60hz
  • Cooling
    NZXT Kraken x73 360mm
  • Keyboard
    Tt eSports Meka G1
  • Mouse
    Logitech G Pro Wireless
  • Operating System
    -Windows 10 Professional 64bit
Link to comment
Share on other sites

Link to post
Share on other sites

Ok, I think I understand.

Do you know how to answer the other questions too? :-)

 

Title just defines the title of the page. This is displayed in the title bar of the browser window. It may have some other obscure functions defined in the HTML spec, but I don't know if or what they are...

Link to comment
Share on other sites

Link to post
Share on other sites

As above, it defines the title of the page, that is, what shows on the tab and/or in the browser window depending on the browser. Some HTML specs require a title to be valid

I am good at computer

Spoiler

Motherboard: Gigabyte G1 sniper 3 | CPU: Intel 3770k @5.1Ghz | RAM: 32Gb G.Skill Ripjaws X @1600Mhz | Graphics card: EVGA 980 Ti SC | HDD: Seagate barracuda 3298534883327.74B + Samsung OEM 5400rpm drive + Seatgate barracude 2TB | PSU: Cougar CMX 1200w | CPU cooler: Custom loop

Link to comment
Share on other sites

Link to post
Share on other sites

Title just defines the title of the page. This is displayed in the title bar of the browser window. It may have some other obscure functions defined in the HTML spec, but I don't know if or what they are...

So this is enough?

On the question sheet I have 2 rows to answer.

I think they want a longer answer.

PC  Specs 2022:

Spoiler
  • CPU
    AMD Ryzen R9 5900x @ 5.1GHz - Auto OC
  • Curve Optimizer Magnitude: -20
  • Motherboard
    ASUS ROG STRIX x570-F Gaming
  • RAM
                                        Kingston Fury 32GB DDR4 3200MHz 16x2GB
  • GPU
    MSI 3070 8GB Ventus 2x OC
  • Case
    LIAN LI LANCOOL MESH II Mesh RGB Black
  • Storage
    Kingston NV1 2TB M.2. NVMe
  • PSU
    Seasonic Focus GX 850w 
  • Display(s)
    MSI OPTIX MAG 251RX IPS 240hz & ASUS MG248Q Vertical 144hz & Dell 60hz
  • Cooling
    NZXT Kraken x73 360mm
  • Keyboard
    Tt eSports Meka G1
  • Mouse
    Logitech G Pro Wireless
  • Operating System
    -Windows 10 Professional 64bit
Link to comment
Share on other sites

Link to post
Share on other sites

For Question 2:

 

The title tag in the head section defines the Title of your webpage.

<head><title>Your Page Title</title></head>

The title attribute represents information about the element. For example, for a link this could be the title of the Linked Page/document or for an Image this could be the name of the Image.

<img src="linktofile" title="This is awesome - Webpage" />

Business Management Student @ University St. Gallen (Switzerland)

HomeServer: i7 4930k - GTX 1070ti - ASUS Rampage IV Gene - 32Gb Ram

Laptop: MacBook Pro Retina 15" 2018

Operating Systems (Virtualised using VMware): Windows Pro 10, Cent OS 7

Occupation: Software Engineer

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×