text overflow

Status
Niet open voor verdere reacties.

cuperuskevin

Gebruiker
Lid geworden
18 nov 2011
Berichten
113
Hallo mensen,

ik heb het volgende probleem:
OverFlowFeedTag.png


Ik heb van alles geprobeerd.
Ik gebruik Bootstrap en dit is de code van de pagina.
Code:
<?php
// Loading config file
include('config.php');

// Loading the header template
include('templates/header/head.tpl.php');

// Loading the core file
include('core.php');

// Mobile Detect
require_once 'mobile_detect.php';
$detect = new Mobile_Detect;

// If the user is not logged in then we
// Let the user login.
if($UserInfo['email'] == "") {
?>

<link href="css/signin.css" rel="stylesheet">

<div class="container">

    <form class="form-signin" method="post" action="index.php?do">
		<h2 class="form-signin-heading"><center><img src="images/LogoFeedTag.png"></center></h2>
		<input name="email" type="email" class="form-control" placeholder="<?php echo $_LANGUAGE['EmailPlaceholder']; ?>" required autofocus>
		<input name="password" type="password" class="form-control" placeholder="<?php echo $_LANGUAGE['PasswordPlaceholder']; ?>" required>
		<label class="checkbox">
			<input type="checkbox" value="remember-me"> <?php echo $_LANGUAGE['RememberMe']; ?>
		</label>
		<button class="btn btn-lg btn-primary btn-block" type="submit"><?php echo $_LANGUAGE['LoginButton']; ?></button>
		
		<?php if(isset($_GET['do'])) {
		$email = $_POST['email'];
		$password = $_POST['password'];
		$password_crypt = md5(md5(md5(md5(md5(md5(md5(md5(md5(md5($_POST['password']))))))))));
		$Login_SQL = mysql_query("SELECT * FROM users WHERE email='".mysql_real_escape_string($email)."' AND password='".mysql_real_escape_string($password_crypt)."'")or die(mysql_error()); 
		$Login_ROWS = mysql_num_rows($Login_SQL);
			if ($Login_ROWS == "0") {
				echo '<br>
				<div class="alert alert-danger alert-dismissable">
					<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>'.$_LANGUAGE['LoginFailed'].'</div>';
			} else if($Login_ROWS == "1") { 
				echo '<br>
				<div class="alert alert-success alert-dismissable">
				<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>'.$_LANGUAGE['LoginSuccess'];
				FeedCrypto($email);
				FeedCrypto($password);
				echo '</div>';
				setcookie("EmailSession", md5(md5(md5(md5(md5(md5(md5(md5(md5(md5($email)))))))))));
				echo '<META HTTP-EQUIV="refresh" CONTENT="5;URL=index.php">';
			} 
		} ?>
	</form>
	<?php if ($detect->isMobile()) { ?>
	<form class="form-signin" style="margin-top:-12px;" action="register.php">
		<button class="btn btn-lg btn-success btn-block" style="font-size:18px;"><?php echo $_LANGUAGE['RegisterButton']; ?></button>
	</form>
	<?php } ?>
	
	<?php if (!$detect->isMobile()) { ?>
	<div class="registerdiv"><button class="btn btn-lg btn-success btn-block" style="width: 200px" onclick="location.href='register.php'"><?php echo $_LANGUAGE['RegisterButton']; ?></button></div>
	<div class="info"><h3><?php echo $_LANGUAGE['RegisteredUsers']; ?></h3><br></div>
	<?php } ?>
</div>

<?php
// If the user is logged in then show
// the user interface
} else {
?>

<link href="css/offcanvas.css" rel="stylesheet">

<?php include('templates/header/head_template.tpl.php'); ?>

    <div class="container">
      <div class="row row-offcanvas row-offcanvas-right">

        <div class="col-xs-12 col-sm-9">
          <div class="well">
			
			
			<?php
			// Show the posts
			$Posts_SQL = mysql_query("SELECT * FROM wall")or die(mysql_error());
			while($Posts_ROWS = mysql_fetch_array($Posts_SQL)) { 
				$UserSelect_SQL = mysql_query("SELECT * FROM users WHERE id='".mysql_real_escape_string($Posts_ROWS['user_id'])."'")or die(mysql_error());
				while($UserSelect_ROWS = mysql_fetch_array($UserSelect_SQL)) { ?>
					<table border="1" style="width:100%;">
						<tr>
							<td width="50" valign="top">
								<img width="50" height="50" src="../img/users/<?php echo $UserSelect_ROWS['image_url']; ?>" style="-moz-border-radius: 5px; -webkit-border-radius: 5px; -khtml-border-radius: 5px; border-radius: 5px;">
							</td>
							<td width="6">							
							</td>
							<td style="font-family: Verdana,Arial,Helvetica,sans-serif; font-size:11px; word-wrap: normal | break-word;" valign="top">
								<a href="#"><?php echo $UserSelect_ROWS['firstname']." ".$UserSelect_ROWS['lastname']; ?></a><br>
								<font style="color:#585858;"><?php echo $Posts_ROWS['posted_on']; ?></font><br><br>
								<!-- POST -->
								<div style="box-sizing: border-box; border:1px solid pink">

								<div style="width: 100%; overflow: auto;"><?php echo htmlspecialchars($Posts_ROWS['text'], ENT_QUOTES); ?></div><br><br></div>
								<div class="btn-group btn-group-xs">
									<button type="button" class="btn btn-primary">(30) + Appel</button>
									<button type="button" class="btn btn-success">(4) Reageer</button>
									<button type="button" class="btn btn-info">Retag</button>
								</div>
							</td>
						</tr>
					</table><hr>
				<?php }
			} ?>
			
		  </div>
        </div><!--/span-->

        <?php include('templates/right_bar.tpl.php'); ?>
      </div><!--/row-->

      

      <?php if (!$detect->isMobile()) { echo "<hr>"; include('templates/footer/footer_info.tpl.php'); } ?>

    </div>
<?php
// End of the loggedin or not code
}

// Loading the footer template
include('templates/footer/footer.tpl.php');
?>
 
In het stukje "show post" kun je bij de <td> in de style een vaste breedte zetten.
bijvoorbeeld width:300px;
 
Laatst bewerkt:
In het stukje "show post" kun je bij de <td> in de style een vaste breedte zetten.
bijvoorbeeld width:300px;

Dat is het juist, dan werkt het. Maar dit is Bootstrap. En in de '<div class="well">' is het al 100% maar als ik bv width:300px; doe dan word hij niet zo breed als de div class well. Het is een pagina voor Mobiel en Desktop en hij moet zich kunnen aanpassen aan de pagina.

Is er misschien een andere optie zodat die kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk word aangepast automatisch aan de post.
 
Geen PHP dus verplaatst naar CSS

Daarnaast; Hoe realistisch is dit? Hoevaak denk je dat zulke lange tekens ingevoerd gaan worden?

Wanneer je een chemisch onderwerp op je website gaat behandelen zou het nog kunnen maar verder komt dit nagenoeg nooit voor.

Wat je zoekt is word-wrap.
 
Laatst bewerkt:
En wat was de oplossing die je gebruikt hebt? Wel zo handig om even te vermelden voor de rest ;)
 
Status
Niet open voor verdere reacties.

Nieuwste berichten

Terug
Bovenaan Onderaan