CSS only work sometimes
I am having a tiny bit of trouble with CSS and a link style. I want it to have inline-block, which does work on some pages but on other it just won't show.
It shows the text as white, which is set in the link style class of the CSS:
As said it does read the color and I can change the text color from white to black, but it just won't show the inline-block. It shows the block on the index page but once I go to profile page it just won't show it.
padding: 5px 15px;
You can view the page on http://p4.bitbender.dk, here the index file works fine, and in "latest fights" it does show the inline block.
<?php session_start(); ?>
<!-- Set fonts and charset plus general information of the site -->
<title>Welcome to ******</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<!-- Using googles fonts and the css file -->
<link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,600" rel="stylesheet" type="text/css" />
<link href="css/css.css" rel="stylesheet" type="text/css" media="all" />
<!-- The whole wrapper around the site -->
<!-- Start header -->
<!-- Ready for text on top picture -->
<!-- Start login info -->
//$member = unserialize($_SESSION['member']);
if ( isset($_SESSION['member_id']) )
printf("Welcome %s (%s %s)! <a href='logout.php'>Sign out</a>", $_SESSION['username'], $_SESSION['first_name'], $_SESSION['last_name']);
<!-- Start menu -->
<div class="ribbon ribbon-content">
<li class="current_page_item"><a href="index.php">Home</a></li>
<!-- start content -->
<!-- post news -->
//Sample button for admins
if ( isset ($_SESSION['member_id']) )
$memberrole = new MemberRoleController();
$roles = $memberrole->getRolesByMemberID($_SESSION['member_id']);
foreach ( $roles as $role )
if ( $role->role === "Admin")
echo '<p><a href="write_news.php" class="link-style">Write new news</a></p>';
//include the news.php file for showing and publishing news
$NewsController = new NewsController();
$newsarray = $NewsController->getNews(3);
//Publish news on the front page
foreach ($newsarray as $news)
<p><img src="%s" width="680" height="200" alt="" /></p>
<p>%s - %s</p>', $news->headline, $news->Image, $news->date, $news->content);
echo '<p><a href="all_news.php" class="link-style">More...</a></p>';
<!-- Start lastest fights -->
<!-- Footer for copyright notice -->
<p>Copyright © Uni group Bi405F13</p>
Now the profile code:
Profile code in next post can't post more than 1k chars...
The page is here: http://p4.bitbender.dk/profile.php
here it won't show the inline block, but it still reads that the text color should be white, and I can change that to black.
Furthermore, if I right click on where the box should be and press "Expect element" (FireFox) I can review the CSS code. If I go down to the link style CSS code here, there is an inline of the line where it writes "display: inline-block;" but that does not happen on any of the other pages.
How come I can't get it to show the inline block?
This is my very first time I ever try CSS/HTML/PHP so there might be something weird happening. If you need more information please tell and I'll be happy to share them.
If you want to try the login on the profile page I have created a user:
Thanks in advance!
Don't use inline-block. It sucks and doesn't work well. Use block and float left/right.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)