Results 1 to 9 of 9
  1. #1
    wizardshogwarts's Avatar
    Join Date
    Jun 2017
    Gender
    male
    Location
    Ulm
    Posts
    621
    Reputation
    116
    Thanks
    64
    My Mood
    Sneaky

    Stuck with this project.

    Hell guys So i'm learning html+ccs.

    So I am making a project but I am stuck. Something with my header:

    This is what i need to get:

    Couple of thinks that i tried:

    Tried to put the tree image ass a background-image. but that didn't work wasn't be able to put the image next the h1(make-a-wishlist for santa!)
    So then i tried to put image in html. so I can place the image and the h1 as display: inline-block. (so now the image and the h1 are next to each other.)
    Problem is i want to push the h1 a bit up so it stays in the middle of the picture.

    This is what im able to do:


    the header has to be centered.

    Anyone who can help me put the h1(make-a-wishlist for santa!) like this:

    Code:

    <header>
    <img src="images/xmas-tree.gif" title="xmas-tree" name="xmas-tree"/>
    <h1>Make-a-wishlist for Santa!</h1>
    </header>


    ps: don't worry about the background i'm able do it.

  2. #2
    wizardshogwarts's Avatar
    Join Date
    Jun 2017
    Gender
    male
    Location
    Ulm
    Posts
    621
    Reputation
    116
    Thanks
    64
    My Mood
    Sneaky
    Bumping this still havent found it. no css/html users?

  3. #3
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    I'm not a web developer, but adding vertical-align: middle; to both the image and h1, in addition to the inline-block style causes it to align the way you want. Hopefully a web dev can give you a better answer.
    Ah we-a blaze the fyah, make it bun dem!

  4. The Following User Says Thank You to Hell_Demon For This Useful Post:

    wizardshogwarts (10-31-2017)

  5. #4
    wizardshogwarts's Avatar
    Join Date
    Jun 2017
    Gender
    male
    Location
    Ulm
    Posts
    621
    Reputation
    116
    Thanks
    64
    My Mood
    Sneaky
    Quote Originally Posted by Hell_Demon View Post
    I'm not a web developer, but adding vertical-align: middle; to both the image and h1, in addition to the inline-block style causes it to align the way you want. Hopefully a web dev can give you a better answer.
    You did help me in a way. But to place the img en text closer. any ideas?



    - - - Updated - - -

    Like should i put the img as background image.

  6. #5
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    Try a negative margin; https://www.w3schools.com/css/css_margin.asp
    That should bring them closer together.
    Ah we-a blaze the fyah, make it bun dem!

  7. The Following User Says Thank You to Hell_Demon For This Useful Post:

    wizardshogwarts (11-01-2017)

  8. #6
    wizardshogwarts's Avatar
    Join Date
    Jun 2017
    Gender
    male
    Location
    Ulm
    Posts
    621
    Reputation
    116
    Thanks
    64
    My Mood
    Sneaky
    Quote Originally Posted by Hell_Demon View Post
    Try a negative margin; https://www.w3schools.com/css/css_margin.asp
    That should bring them closer together.
    allready thought of this but my teacher hates using negative margin. so there should be another way to fix this.
    but thanks for your effort.

  9. #7
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    I guess setting the image as background and offsetting the text would then indeed be the best solution. Again, I'm not a web developer, I just tried some stuff in a html fiddle to see what could work.
    Ah we-a blaze the fyah, make it bun dem!

  10. The Following User Says Thank You to Hell_Demon For This Useful Post:

    wizardshogwarts (11-01-2017)

  11. #8
    Stack's Avatar
    Join Date
    Jan 2015
    Gender
    male
    Posts
    1,705
    Reputation
    87
    Thanks
    272
    My Mood
    Relaxed
    Centering images nested inside a div are done using

    Code:
    margin: 0 auto;
    That will horizontally align your image using div's properties (set up the width to 100% or to 100vw)


    Oh rofl, I misread your request.

    To vertical align a h1 so it has the same height as the image, use min-height and max-height and they have to be equal to div's height parent.
    Last edited by Stack; 11-01-2017 at 05:16 PM.

    VOYAGE OF EMOTION AND DISCOVERY

    Graphics Shop - Web Design & Development

  12. #9
    Matthew's Avatar
    Join Date
    Mar 2017
    Gender
    male
    Posts
    5,330
    Reputation
    1162
    Thanks
    1,156
    Use w3 to help you code websites, center images, etc

    It helped me

Similar Threads

  1. [Help] Stuck with this !@#$%
    By MJCreado in forum WarRock Korea Hacks
    Replies: 8
    Last Post: 01-09-2012, 11:51 PM
  2. I need help with this project
    By killer121561 in forum Combat Arms Coding Help & Discussion
    Replies: 7
    Last Post: 08-02-2011, 07:42 PM
  3. wats wrong with this weapon code
    By CHECK2PASS in forum WarRock - International Hacks
    Replies: 3
    Last Post: 07-03-2007, 04:38 AM
  4. sf0d plays with this shit
    By iverson954360 in forum General
    Replies: 4
    Last Post: 04-08-2007, 04:40 PM
  5. with this post
    By ace76543 in forum General
    Replies: 5
    Last Post: 12-24-2006, 05:46 PM