XAMPP doesn't seem to like some of my CSS

Problems with the Windows version of XAMPP, questions, comments, and anything related.

XAMPP doesn't seem to like some of my CSS

Postby KarenC996 » 29. October 2020 12:33

Hi, I am trying to run some html code with a line of php in to test an included php file. The php section worked fine but I noticed that two elements of my webpage had been ignored by Apache. These showed up fine when I previewed them in notebook++. I'm wondering if Apache objected to hashtags in associated css file but if so why only for those two elements? It displayed all the others without any issue and the css contained hashtags for them too.
The html and corresponding css codes for the affected elements are shown below.

HTML
<div id="adbox1"><p>adbox1</p></div>
<div id="adbox2"><p>adbox2</p></div>

CSS
div#adbox1{
position:absolute;
top:50%;
left:85%;
height:130px;
width:140px;
border:thin solid;
}
div#adbox2{
position:absolute;
top:95%;
left:85%;
height:110px;
width:190px;
border:thin solid;
}
If you can see any issue with above coding could you let me know please? I am completely baffled why Apache discriminates against those two elements. :?
KarenC996
 
Posts: 8
Joined: 20. June 2020 11:05
XAMPP version: 3.2.4
Operating System: WINDOWS10

Re: XAMPP doesn't seem to like some of my CSS

Postby Nobbie » 29. October 2020 13:38

Apache does not "ignore" CSS; it also does not interprete CSS. CSS is interpreted by the browser, Apache knows nothing about CSS. Apache simply delivers the HTML File.

I dont know if you misplaced CSS or HTML in your code, as we do not see the full HTML code. But it is definately not an Apache issue, neither Xampp.

P.S.: OMG!!!

That took me a whole hour. I tried to run a simply HTML Script with your CSS Code and - i could see the boxes for a second, then they disappeared. I tried everything, i used "class" instead of "id", i used different Ids (instead of "adbox1" etc.) and ... it worked!! WHY???

I got it now: I have an Adblocker installed and running, This Adblocker removes the boxes!!!! Rename your ids from "adbox" to anything else and it works! O my god...
Last edited by Nobbie on 29. October 2020 14:40, edited 1 time in total.
Nobbie
 
Posts: 13214
Joined: 09. March 2008 13:04

Re: XAMPP doesn't seem to like some of my CSS

Postby Altrea » 29. October 2020 14:34

Are all your assets (css, is, images, etc.) requested successful? Check for example with help of the chrome web developer tools.

If this part not working is somewhare related with the php code part then please check if your file extension is .php and not .html

Check if your browser renders localhost code different then online URLs (mostly the internet explorer will change in someway of quirks compatibility mode for localhost resources.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11952
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: XAMPP doesn't seem to like some of my CSS

Postby Nobbie » 29. October 2020 14:41

See my "P.S."!!
Nobbie
 
Posts: 13214
Joined: 09. March 2008 13:04

Re: XAMPP doesn't seem to like some of my CSS

Postby KarenC996 » 29. October 2020 17:02

Cheers for the replies, I will change some of element names and see if that has any effect. All my other images etc that I have styled in css have been successful so I will presume problem just lies in definition of those two elements. Its first time I've ever used xampp so I didnt really know what to expect from it.
KarenC996
 
Posts: 8
Joined: 20. June 2020 11:05
XAMPP version: 3.2.4
Operating System: WINDOWS10

Re: XAMPP doesn't seem to like some of my CSS

Postby Altrea » 29. October 2020 18:10

KarenC996 wrote:Its first time I've ever used xampp so I didnt really know what to expect from it.

It is still not an XAMPP issue.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11952
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: XAMPP doesn't seem to like some of my CSS

Postby KarenC996 » 30. October 2020 16:11

Whoever suggested I change some div names; cheers, I tried that and it worked a treat. :)
KarenC996
 
Posts: 8
Joined: 20. June 2020 11:05
XAMPP version: 3.2.4
Operating System: WINDOWS10

Re: XAMPP doesn't seem to like some of my CSS

Postby Nobbie » 30. October 2020 21:21

"Whoever" is me and that took me a lot of work to find out that really weird behaviour and the reason for it. Feel free to tip me properly.... ;)
Nobbie
 
Posts: 13214
Joined: 09. March 2008 13:04

Re: XAMPP doesn't seem to like some of my CSS

Postby KarenC996 » 30. October 2020 22:13

Cheers!!
KarenC996
 
Posts: 8
Joined: 20. June 2020 11:05
XAMPP version: 3.2.4
Operating System: WINDOWS10


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 119 guests