/    Sign up×
Community /Pin to ProfileBookmark

CSS only work sometimes

Hello all!

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:

[CODE].link-style {
display: inline-block;
margin-top: 10px;
padding: 5px 15px;
background: #000000;
letter-spacing: 1px;
text-decoration: none;
color: #FFFFFF;
}
[/CODE]

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.

The index.php:

[CODE]<?php session_start(); ?>
<html>
<head>
<!– 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” />
</head>
<body>
<!– The whole wrapper around the site –>
<div id=”wrapper”>
<!– Start header –>
<div id=”header”>
<div id=”logo”>
<!– Ready for text on top picture –>
</div>
</div>
<!– Start login info –>
<div id=”login”>
<?php
//$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’]);
}

else
{
printf(‘<a href=”login.php”>Login</a>’);
}
?>
</div>
<!– Start menu –>
<div id=”menu-wrapper”>
<div class=”ribbon ribbon-content”>
<div id=”menu”>
<ul>
<li class=”current_page_item”><a href=”index.php”>Home</a></li>
<li><a href=”profile.php”>Profile</a></li>
<li><a href=”tournaments.php”>Tournaments</a></li>
<li><a href=”gyms.php”>Gyms</a></li>
</ul>
</div>
</div>
</div>
<!– start content –>
<div id=”columns”>
<div class=”content”>
<!– post news –>
<div id=”column1″>
<?php

//Sample button for admins
if ( isset ($_SESSION[‘member_id’]) )
{
include_once ‘php/Role.php’;

$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
include ‘php/News.php’;

$NewsController = new NewsController();
$newsarray = $NewsController->getNews(3);

//Publish news on the front page
foreach ($newsarray as $news)
{
printf(‘<h2>%s</h2>
<p><img src=”%s” width=”680″ height=”200″ alt=”” /></p>
<p>%s – %s</p>’, $news->headline, $news->Image, $news->date, $news->content);
}
unset($NewsController);
echo ‘<p><a href=”all_news.php” class=”link-style”>More…</a></p>’;
?>
</div>
<!– Start lastest fights –>
<div id=”column2″>
<?php
include_once ‘php/latestFights.php’;
?>
</div>
</div>
</div>
<!– Footer for copyright notice –>
<div id=”footer”>
<p>Copyright &copy; Uni group Bi405F13</p>
</div>
</div>
</body>
</html>[/CODE]

You can view the page on [url]http://p4.bitbender.dk[/url], here the index file works fine, and in “latest fights” it does show the inline block.

Now the profile code:
Profile code in next post can’t post more than 1k chars…

The page is here: [url]http://p4.bitbender.dk/profile.php[/url]

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:
username: Weee
password: weee

Thanks in advance!

to post a comment
CSS

1 Comments(s)

Copy linkTweet thisAlerts:
@JavaboeyMay 16.2013 — Don't use inline-block. It sucks and doesn't work well. Use block and float left/right.
×

Success!

Help @Jelle spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...