- This topic is empty.
-
AuthorPosts
-
July 26, 2013 at 10:08 pm #144778
gmeikncc.1701
ParticipantSo I’m coding a tumblr theme for my friend: I do the code, she does the art assets. It was progressing along fine and turning out mostly glitch-free in firefox, so I figured I’d show her how it was coming along. She’s using chrome and it showed up to be a glitchy pile of dung in her browser window. I opened the site in chrome and sure enough, it was a glitchy pile of dung. Again, my code was working fine in FF! But wait, it gets stranger! My simple and sub par tumblog which also uses lots of fixed positioning, is working fine in chrome! (I coded the majority of this blog the day before yesterday) What could I be doing wrong? Here is the glitchy blog and I’ve included the code for the fixed elements below. #word{
z-index:1;
position:fixed;
border-top:2px dotted white;
width:120%;
margin-left:-2px;
padding:5px;
}
#topbar{
width:120%;
background-image: url(“http://i.imgur.com/rexW3uh.png”);
margin:-8px;
height:112px;
opacity:0.25;
z-index:-1;
position:fixed;}
#behind{
width:120%;
margin:-8px;
height:112px;
opacity:1;
z-index:-4;
background-color:#272727;
position:fixed;
}#linkbar{
background-color:#272727;
height:38px;
width:120%;
border-top:2px solid #2d2d2d;
border-bottom:1px solid #121212;
margin-left:-23px;
position:fixed;
text-align:center;
margin-top:78px;
box-shadow: 5px 5px 20px #121212;
}#link-text{ position:absolute; top:50%; margin-top:-5px; }
and the html
<div> </div> <div></div> <div><behind></div> <div> <div>embed code for music player</div></div>
thank you so much for your help!
July 27, 2013 at 2:28 am #144800dgriesel
Participantlooks fine for me in FF and Chrome, except the fixed background is scrolling with the page in Chrome.
July 27, 2013 at 8:51 am #144842gmeikncc.1701
ParticipantYeah! that’s the problem, mostly. The background and the topbar should be fixed, with the blog content scrolling behind, as it is in firefox. My question is: why would position:fixed work in FF but not Chrome? And why is it specific to this code, when something I just wrote used fixed positioning fine in chrome! it’s so weird!
July 27, 2013 at 10:50 am #144849Paulie_D
MemberWithout going through the entire code it seems that you have a whole bunch of positioning going on.
Surely the only thing that needs positioning is a single element (the nav bar) and you just put everything in that that you want to stay still.
July 27, 2013 at 8:28 pm #144861gmeikncc.1701
ParticipantOkay, I’ll try it! This doesn’t fix the fairly obvious problem of the background-attachment, though, which also isn’t working.
July 27, 2013 at 9:12 pm #144862gmeikncc.1701
ParticipantUPDATE:
Using -webkit-transform: translateZ(0); worked for other elements, but I’m still stumped about background-attachment, which still doesn’t work. is there any way to apply -webkit-transform: translateZ(0); to a background?July 28, 2013 at 12:24 am #144869Paulie_D
MemberI’m not sure what the heck is going on with your HTML…you seem to have invented a whole bunch of new elements.
July 28, 2013 at 8:24 am #144883gmeikncc.1701
ParticipantI’m new to this and self-taught: I assumed that I could name divs whateverthecrap I wanted as long as it matched what I have in my css.
July 28, 2013 at 8:31 am #144884gmeikncc.1701
ParticipantAnd including everything in one fixed div is just making weird stuff happen without fixing the main problem: that position:fixed was doing absolutely nothing in webkit browsers. Regardless of my weird html, everything is working fine except for the background-attachment:fixed property is also not working in webkit browsers and elsewhere on the internet isn’t helping me with that.
July 28, 2013 at 9:20 am #144885Paulie_D
MemberI’m new to this and self-taught: I assumed that I could name divs whateverthecrap I wanted as long as it matched what I have in my css.
Clearly you were wrong.
July 28, 2013 at 9:27 am #144886Paulie_D
Member<topbar> </topbar> <word></word> <behind></behind> <linkbar><link-text></link-text></linkbar>
July 28, 2013 at 9:36 am #144887gmeikncc.1701
ParticipantHAhahahaha Paulie_D I guess that’s not true since it’s working! I used code for fullsized background images by Chris Coyier. However, since position:fixed isn’t working for me in chrome, I used -webkit-transform: translateZ(0), but this overrode the z-index, so I also included -webkit-transform: translate3d(0px, 0px, 0px), and now everything is working a-okay in all major browsers (but I haven’t checked ie, I’ll ask my friend to later so I don’t have to install the beast)
I will not be visiting this forum again. I was able to solve my problem on my own and received little more than snarky comments from the users of this site. Your replies were devoid of constructive criticism or substantial advice, and as a serial n00b I can say that making people feel stupid without teaching them how to better themselves is a good way to discourage them from developing their skills in any area
June 25, 2014 at 5:02 am #173657sunnykgupta
ParticipantTrust me, you should not form an opinion of the world after meeting a single rude guy.
You were right all along, try having a look at the discussion here: http://stackoverflow.com/q/6164000/1477051
Some will try and guide you to solutions, while others (old-school) will try to tie you up with standards. (set by them)
I’m sure you are way ahead in your HTML knowledge now. :)
November 13, 2014 at 9:19 am #188228cauli
ParticipantFor everyone searching for a solution to this problem:
This just happened to me, I solved it by removing any 3D transforms from the parent of the div you want fixed (mine was a completely unnecessary “-webkit-transform: translateZ(-1000px);” in the <body> tag).
Elements probably get fixed to the 3D element instead of fixing itself to the viewport (browser window) when the body is transformed.
On the custom tags discussion: http://www.html5rocks.com/en/tutorials/webcomponents/customelements/
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.