BullGuard Antivirus Sale - 60% Off with openElement !
Forum Home Forum Home >

openElement

> Error Reports
  New Posts New Posts RSS Feed - Calc is not working everytime
  FAQ FAQ  Forum Search   Register Register  Login Login

Calc is not working everytime

 Post Reply Post Reply
Author
Message
Andres View Drop Down
Newbie
Newbie


Joined: Oct 23 2014
Location: Nederland
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote Andres Quote  Post ReplyReply Direct Link To This Post Topic: Calc is not working everytime
    Posted: Jan 04 2016 at 7:25am
I hope someone can help me out: I'am using in a layout a textblock and a image, in a narrow window the image comes below the textblock and both needs to be centered. I use the function Calc for both the textblock and image. The textblock is nice in the middle but the image is not ? Here is an example of the code I've used:
@media (min-width: 751px) and (max-width: 850px){
.txt_welkom {top: 205px !important; height: 200px !important; width:
630px !important; left: calc(49% - 315px) !important;}
.img_homepage {top: 435px !important; width: 640px !important; height:
394px !important; left: calc(50% -320px) !important;}
}
If you have any suggestions, please help me out. Thank you
Back to Top
Dmit OE View Drop Down
Admin Group
Admin Group


Joined: May 31 2012
Status: Offline
Points: 5283
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dmit OE Quote  Post ReplyReply Direct Link To This Post Posted: Jan 04 2016 at 8:31am
Hi,

It is important that you publish your website somewhere and give the link, to see what happens.

Have a nice day
D
Back to Top
Andres View Drop Down
Newbie
Newbie


Joined: Oct 23 2014
Location: Nederland
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote Andres Quote  Post ReplyReply Direct Link To This Post Posted: Jan 05 2016 at 1:39pm
It is publisched: http://test.ekvtilburg.nl/index.php
Still needs a lot of work. I hope you can find the solution.
Back to Top
Dmit OE View Drop Down
Admin Group
Admin Group


Joined: May 31 2012
Status: Offline
Points: 5283
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dmit OE Quote  Post ReplyReply Direct Link To This Post Posted: Jan 05 2016 at 2:08pm
What is the image in question (that is not centered)?

Could you please remove "Disable the right-click"? It doesn't really prevent from stealing your content, but the page analysis gets very incomfortable.
Back to Top
Andres View Drop Down
Newbie
Newbie


Joined: Oct 23 2014
Location: Nederland
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote Andres Quote  Post ReplyReply Direct Link To This Post Posted: Jan 06 2016 at 12:26pm
The richt click diabled is removed. It is the larger image with the crane (img_homepage ), the image will be smaller in size when the website is finished. When the screensize is reduced below 850px it should be centered. The 4 images below this image ( also not the final images ) should be evenly distrubed below the image. I also tried with vw instead of % but also didn't work. Good luck.
Back to Top
Dmit OE View Drop Down
Admin Group
Admin Group


Joined: May 31 2012
Status: Offline
Points: 5283
Post Options Post Options   Thanks (1) Thanks(1)   Quote Dmit OE Quote  Post ReplyReply Direct Link To This Post Posted: Jan 06 2016 at 12:42pm
For a start, correct all the calc to surround "-" with spaces:

calc(50% - 320px) !important

" - 320px" not " -320px""
Back to Top
Andres View Drop Down
Newbie
Newbie


Joined: Oct 23 2014
Location: Nederland
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote Andres Quote  Post ReplyReply Direct Link To This Post Posted: Jan 07 2016 at 11:39am
Thank you very much, I overlooked this simple solution.    
Back to Top
Andres View Drop Down
Newbie
Newbie


Joined: Oct 23 2014
Location: Nederland
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote Andres Quote  Post ReplyReply Direct Link To This Post Posted: Jan 27 2016 at 8:48am
For everyone who wants to use calc:

Be sure to have a fallback for older browsers , older native android browsers and opera mini.

For example a size in pixels or percentage and a size in Calc.

It is a little bit more work , but Calc is a function worth exlporing and can solve or improve a lot of issues.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.