Horse Eden Eventing Game
Horse Eden Eventing Game


Year: 202   Season: Winter   
$: 0
Forecast: Sunny and Warmer
Forecast:
Fri 02:25pm  
Stables Online:  124   Go Raid
Chatbox
Gaelic Gladiacres
02:25:00 Gladius
BB - yes!
Manson Stables
02:24:36 MS
I just noticed that I have an absolute hoard of straws XD most are from my early days of HEE when EEE straws were worth something
Blood Bay
02:23:54 BB
-HEE Click- is this filly Manchado? There are new things popping up all the time I can't keep up xD
Telepath
02:15:23 DL
AL
Alright, thanks <3
RiverView Ponies
02:14:58 Willow/Lil
And after several excruciating hours (45 minutes) all my horses are named
Motonemi
02:14:58 AL, mum to Nemi
Telepath, ISH
Telepath
02:14:35 DL
What breed would it turn out if I do KNN x ISH?
Cappuccino
01:37:51 Heyy it's Capp
No red bags Trish! One in the friend group is enough for now, k, thanks <3
Stormsong Manor
01:34:38 Ven
There are so many awful horse owners. More so than good ones.
Motonemi
01:32:55 AL, mum to Nemi
Raven, I'll take a look :)
Ravenwood Farm
01:32:30 Raven
AL
Charon could be good maybe?
Greenheart Stables
01:32:27 Gren|Grenlin|Snek
@Dino
Ew? I couldn't imagine being made to move while heavily pregnant/about to give birth. Thats just making the poor mare stressed
The Old Gods
01:32:05 Void Malign
That's because people are idiots.
Motonemi
01:32:03 AL, mum to Nemi
Whaaa? The poor horses they own...
Gaelic Gladiacres
01:30:58 Gladius
those poor mares... x_x
Morning Glory Farms
01:30:33 Dino/Digital Tyrant
That's ok, I had someone tell me yesterday that I should just start LUNGING her everyday for an hour and then she'll foal... I was like bro and you nuts that's so unfair and I got told I was soft and that that's what they did to induce their horses when they had them
Motonemi
01:29:08 AL, mum to Nemi
Oh, then better be close and pull your hair
Morning Glory Farms
01:28:26 Dino/Digital Tyrant
I would, but my luck she'll need pulled or have a red bag and I'll be to far away to help her
Morning Glory Farms
01:28:00 Dino/Digital Tyrant
I'm debating adding her to my foal guessing contest because she's another one that could be fun colours 😂
Motonemi
01:27:32 AL, mum to Nemi
Dino, just do what someone suggested. Go on a trip or something

You must be a registered member for more
than 1 day before you can use our chatbox.



Rules   Hide
You are in: Main Chat
View Sales Chat
Quests

Embark on a Quest.

Horse Eden Eventing Game
Chatbox
Gaelic Gladiacres
02:25:00 Gladius
BB - yes!
Manson Stables
02:24:36 MS
I just noticed that I have an absolute hoard of straws XD most are from my early days of HEE when EEE straws were worth something
Blood Bay
02:23:54 BB
-HEE Click- is this filly Manchado? There are new things popping up all the time I can't keep up xD
Telepath
02:15:23 DL
AL
Alright, thanks <3
RiverView Ponies
02:14:58 Willow/Lil
And after several excruciating hours (45 minutes) all my horses are named
Motonemi
02:14:58 AL, mum to Nemi
Telepath, ISH
Telepath
02:14:35 DL
What breed would it turn out if I do KNN x ISH?
Cappuccino
01:37:51 Heyy it's Capp
No red bags Trish! One in the friend group is enough for now, k, thanks <3
Stormsong Manor
01:34:38 Ven
There are so many awful horse owners. More so than good ones.
Motonemi
01:32:55 AL, mum to Nemi
Raven, I'll take a look :)
Ravenwood Farm
01:32:30 Raven
AL
Charon could be good maybe?
Greenheart Stables
01:32:27 Gren|Grenlin|Snek
@Dino
Ew? I couldn't imagine being made to move while heavily pregnant/about to give birth. Thats just making the poor mare stressed
The Old Gods
01:32:05 Void Malign
That's because people are idiots.
Motonemi
01:32:03 AL, mum to Nemi
Whaaa? The poor horses they own...
Gaelic Gladiacres
01:30:58 Gladius
those poor mares... x_x
Morning Glory Farms
01:30:33 Dino/Digital Tyrant
That's ok, I had someone tell me yesterday that I should just start LUNGING her everyday for an hour and then she'll foal... I was like bro and you nuts that's so unfair and I got told I was soft and that that's what they did to induce their horses when they had them
Motonemi
01:29:08 AL, mum to Nemi
Oh, then better be close and pull your hair
Morning Glory Farms
01:28:26 Dino/Digital Tyrant
I would, but my luck she'll need pulled or have a red bag and I'll be to far away to help her
Morning Glory Farms
01:28:00 Dino/Digital Tyrant
I'm debating adding her to my foal guessing contest because she's another one that could be fun colours 😂
Motonemi
01:27:32 AL, mum to Nemi
Dino, just do what someone suggested. Go on a trip or something

You must be a registered member for more
than 1 day before you can use our chatbox.






Refresh


Forums

→ Horse Eden is a fun game! Sign Up Now!

My Subscriptions
My Bookmarks
My Topics
Latest Topics
Following

Forums > Member Help > Guides
   1    2    3 

Den's CSS Guide: Overlapping images + CSS essentials May 22, 2020 05:43 PM

Former Stable
 
Posts: 0
#684544
Give Award

What you’ll learn

I’m going to teach you how to position elements (all your boxes, text, and images) and control how different elements overlap (which element shows up on top), so you can create a cool effect as seen below, with the hoof extending over the main game navigation. We’ll just learn about the overlapping part, so don’t get too excited xD. Toasty did the rest of this incredible CSS wizardry, I just did the overlapping. Example of the overlapping effect

Please share this guide if you find it helpful! You’re welcome to reply to this post to ask questions about anything you don’t understand or simply want clarification on. Lastly, I encourage you to take any and all code samples from this guide to play with and learn from.

In this guide, I’m going to break down the individual steps to create the effect shown in the image above, using full code examples. Throughout, I’ll include direct links to pages from Mozilla’s helpful CSS resources. They include some interactive examples, so you can try it out live!

Some quick terminology

If you want to apply some cool styles to a specific element on the page, you need to specify a CSS selector that describes that element (what element you’re selecting).

An example element is HEE. The a is a tag (where tags include a, table, div, etc.) made for handling links, href is an attribute with a corresponding value of “https://horseeden.com”.

  • If you want to change the style of all link tags, your CSS selector would just be a
  • The id attribute is special and is basically assigning that element’s ID (identifier). (Ideally, the id is unique, but nothing stops you from giving every element the same id.) To select something with the id “hee”, your selector would be #hee and if you want links with the id “hee”, your selector would be a#hee
  • The class attribute is also special and is a way of classifying certain elements. To select all elements with the same class, say “url”, your selector would be .url and for all links with the class “url”, your selector would be a.url

There are many more ways to select elements, see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors

A short warning

As you dive into more advanced CSS, you’ll quickly discover that some styles behave differently on different browsers and devices. Yes, it’s a pain xD There are sometimes CSS properties specific to various browsers/devices and often there are workarounds. There are also tools online that can help with cross-browser styles! However, sometimes all you can do is compromise when a certain browser misbehaves. Make sure to ask about what browsers/devices your palette commissioners use. Pro tip: mobile and Internet Explorer tend to be the hardest to appease!

In this guide, I use Firefox on desktop and have not yet tested it on other devices because I’m lazy.

Starting the palette

For this tutorial, please create a new palette, using the “Default” palette as a base template.

Placing the site header

The usual place for a custom site header uses the CSS selector .gameheader. However, in this tutorial, we want the header to overlap with the site navigation, so our selector will be .gameheader div[style]:first-child.

Wordy description of what that means: .gameheader is the parent (or outer) element, and inside .gameheader, we’re targeting a div tag which has a style attribute (with any value, doesn’t matter), and we only accept it if it’s the first child that shows up in the list of the parent’s immediate children.

Less wordy: Inside the .gameheader div, there are two div children. The second one is the navigation, and the first is where we’ll place our header.

(Why not modify .gameheader? Because the navigation is a child element of the .gameheader element, meaning it’s inside .gameheader. So any changes to the parent element, .gameheader, would affect its child, the navigation. It’s much simpler to place our header in a sibling of the navigation.)

For the purposes of following this guide, you are allowed to use this image: https://i1.lensdump.com/i/jCED2P.png. Just be sure to remove it from your palette after following the guide, as this image has been sold to another user :)

Now scroll to the bottom of your new (test) palette, and paste the following:

.gameheader div[style]:first-child {
    background-image: url(https://i1.lensdump.com/i/jCED2P.png);
    background-repeat: no-repeat;
    background-size: 858px;

    height: 430px !important;
}

We’re setting the background image to a URL, the one I linked above. The background size will have a width of 858px (pixels), and we do not want the background to repeat itself like a pattern, so we specify “no-repeat.” We’re also setting the height to be 430px. The !important must go before the semicolon (;). We add this text because that element already has the height property set to 150px in the HTML itself, so we must insist upon overriding it with the text !important (see below, how the style attribute is already set?) The HTML

Save it and view it, and it should look as below: Adding the image

Positioning elements

There are a number of ways to change how something is positioned (for example, the CSS properties: position, float, margin, display, and so on). Let’s start with the property called position: https://developer.mozilla.org/en-US/docs/Web/CSS/position

position: relative; allows you to change an element’s position from where it currently is (aka relative position). However, all the neighboring elements will still give it the same amount of room, as if it had never moved. It’s kind of like cutting out a small square from a piece of paper, moving it a little up/down/right/left, and taping it back down on the page. The place where you used scissors to cut it out still takes up space, but you’ve shifted the square’s position.

position: absolute; completely removes the element from where it used to reside and plops it down wherever you specify. Normally, it’ll shift all the way to the upper left of the screen (note: if you want it to be positioned relative to another element that happens to contain this one, but you don’t want to leave a gaping space, set this element to position: absolute; and the containing element to position: relative;). It’s like taking a square from a second sheet of paper and taping it anywhere on your first page. There is no gaping space on your first paper.

Feel free to play around with the other values possible (fixed, sticky)!

Overlapping the image with the navigation

Warning: Once you save this next section, you might not be able to access the site navigation. This will be fixed in the section following this one!

Here’s one way we could do it. We can shift it from its current position by 59 pixels from the top.

Wait, how did I know that would be enough pixels? It would be tedious to keep changing it and saving the palette. If you’re on desktop, open up the web inspector to see all the HTML elements and CSS, and directly change values to see how that would look. If you’re on Firefox, see https://developer.mozilla.org/en-US/docs/Tools/Page_Inspector/How_to/Open_the_Inspector. If you’re currently using Chrome, see https://developers.google.com/web/tools/chrome-devtools/css.

Anyway, let’s set our element’s position to relative and ask for it to be shifted from the top by 59px, like so (check the link about position to see further links to top, right, bottom, left, which allow you to shift the image down from the top, from the right, up from the bottom, and from the left, respectively). Edit your code so it now looks like:

.gameheader div[style]:first-child {
    background-image: url(https://i1.lensdump.com/i/jCED2P.png);
    background-size: 858px;
    background-repeat: no-repeat;

    height: 430px !important;
    position: relative;
    top: 59px;
}

Result: Shifting the element

Now there’s this awkward space above it, since all we’ve done is shift it down from its previous position. Let’s get rid of that space by changing the element’s margin (https://developer.mozilla.org/en-US/docs/Web/CSS/margin). Here’s an image visually describing margin vs padding: https://media.prod.mdn.mozit.cloud/attachments/2019/03/19/16558/29c6fe062e42a327fb549a081bc56632/box-model.png Confusingly, if you’re familiar with the concept of page/paper margins, this is not the same “margin”. Page margins are more like CSS padding (https://developer.mozilla.org/en-US/docs/Web/CSS/padding), whereas CSS margins would be all the space immediately outside the paper’s edges.

Positive margins (like 10px or 10%) will increase space between the element’s edges and all its neighbors. Negative margins will decrease that space. So let’s set our element’s top margin (the margin above our element) to -59px (yep, we’re just negating how much we originally shifted the element by!).

.gameheader div[style]:first-child {
    background-image: url(https://i1.lensdump.com/i/jCED2P.png);
    background-size: 858px;
    background-repeat: no-repeat;

    height: 430px !important;
    position: relative;
    top: 59px;
    margin-top: -59px;
}

By the way, this is equivalent to if we simply did not shift the element, and instead set a negative bottom margin, like so (wooo, less code!):

.gameheader div[style]:first-child {
    background-image: url(https://i1.lensdump.com/i/jCED2P.png);
    background-size: 858px;
    background-repeat: no-repeat;

    height: 430px !important;
    position: relative;
    margin-bottom: -59px;
}

Result: Fixing the margin

Final touches

Whoops, by overlapping an image over the navigation, we can no longer click on the navigation links! Makes sense though, right? Fortunately, we can fix this using the pointer-events property (https://developer.mozilla.org/en-US/docs/Web/CSS/pointer-events). <- This link contains a lot of information specific to SVGs (Scalable Vector Graphics), that probably won’t concern you. Set pointer-events: none; so that your mouse (pointer) clicks will ignore our overlapping image and look at all the elements that it’s been covering.

.gameheader div[style]:first-child {
    background-image: url(https://i1.lensdump.com/i/jCED2P.png);
    background-size: 858px;
    background-repeat: no-repeat;

    height: 430px !important;
    position: relative;
    margin-bottom: -59px;

    pointer-events: none;
}

Nav works now!! Fixing navigation

One more fix: you’ll notice the hooves still got cut off. That’s because all the elements below the navigation are still overlapping our image. Introducing the z-index property (https://developer.mozilla.org/en-US/docs/Web/CSS/z-index)! Here we can control the order of overlap, (think about the z-axis). The higher the value, the more “on top” that element will be. (Note that for z-index to work, you need to set position to something like “relative” or “absolute”. Basically, any valid value that isn’t “static”.)

We’ll set our element’s z-index to 100000001. Why this value? That’s because the dropdown navigation (like General, Federation, Futurity, and Junior Riders) has a z-index of 100000000, so we’ll just add 1 to that to assert dominance!

 .gameheader div[style]:first-child {  
     background-image: url(https://i1.lensdump.com/i/jCED2P.png);  
     background-size: 858px;  
     background-repeat: no-repeat;  

     height: 430px !important;
     position: relative;
     margin-bottom: -59px;
     z-index: 100000001;

     pointer-events: none;
 }

Result: Fixed the z-index

And you’re done!

Congrats on making it through! Please ask any questions and let me know of any mistakes :) Oh, and you might want to set the gameheader’s background property to “none”

Wow, I just noticed that the horse’s hoof is ever so slightly covering up how much ebs I have. The original palette featured a much taller nav bar, so this wasn’t an issue lol


Edited at May 22, 2020 06:41 PM by Dense Moors
Den's CSS Guide: Overlapping images + CSS essentials May 22, 2020 07:37 PM

Former Stable
 
Posts: 0
#684673
Give Award
Thanks so much for this!
how would you go about removing the background ?
i usually use the 9th child transparent bg but that bit of code won’t work when I use the one you’ve provided ^^
edit:
the code I used to remove borders, also isn’t working, is there a certain way I have to place it? I put it in under the ‘height’ code
border: 0 !important;

Edited at May 22, 2020 08:04 PM by Sunset Grove Farm
Den's CSS Guide: Overlapping images + CSS essentials May 24, 2020 10:39 PM


Gem

Art Team
 
Posts: 6085
#686782
Give Award
I noticed on the entry for this contest that you had also changed the color of the tabs on the stable page that read 'Featured Horse', "Most Prolific Mares/Sires' etc. Could you perhaps explain how to do this?
Den's CSS Guide: Overlapping images + CSS essentials May 26, 2020 08:41 AM

Former Stable
 
Posts: 0
#688766
Give Award

Sunset Grove Farm said:
Thanks so much for this!
how would you go about removing the background ?
i usually use the 9th child transparent bg but that bit of code won’t work when I use the one you’ve provided ^^
edit:
the code I used to remove borders, also isn’t working, is there a certain way I have to place it? I put it in under the ‘height’ code
border: 0 !important;


Are you referring to the background for the site header? And the border for that same header?

I'd do this:

.gameheader {
background: none;
border: 0 !important;
}
Den's CSS Guide: Overlapping images + CSS essentials May 26, 2020 08:44 AM

Former Stable
 
Posts: 0
#688769
Give Award

Gem said:
I noticed on the entry for this contest that you had also changed the color of the tabs on the stable page that read 'Featured Horse', "Most Prolific Mares/Sires' etc. Could you perhaps explain how to do this?


That was all Toasty's doing :D I have no idea how she did that lol. I basically didn't touch her CSS besides the site header stuff. You can try asking her! Her stable number is 305338
Den's CSS Guide: Overlapping images + CSS essentials May 26, 2020 09:15 AM

Former Stable
 
Posts: 0
#688820
Give Award
Aha it works thank you very much dense!!
Den's CSS Guide: Overlapping images + CSS essentials May 26, 2020 10:10 AM


Gem

Art Team
 
Posts: 6085
#688917
Give Award
Thanks! I certainly will <3
Den's CSS Guide: Overlapping images + CSS essentials May 26, 2020 10:10 AM


Gem

Art Team
 
Posts: 6085
#688918
Give Award
Also wanted to say thanks for making this tutorial in general <3

Edited at May 26, 2020 10:11 AM by Gem
Den's CSS Guide: Overlapping images + CSS essentials May 28, 2020 03:31 AM

Former Stable
 
Posts: 0
#691120
Give Award
Is there anyway to make the header by transparent?
Den's CSS Guide: Overlapping images + CSS essentials May 28, 2020 05:34 AM

Former Stable
 
Posts: 0
#691181
Give Award

Ladybird Estate said:
Is there anyway to make the header by transparent?


To remove the original game header image, try:

.gameheader {
background: none;
}

Forums > Member Help > Guides
   1    2    3 

Refresh