I am trying to wrap text around an image, just like this issue:
Wrap text around bootstrap image
I have tried all the solutions there and none of them worked.
Here is my layout I am working with:
div.col-md-6
img.imagePost(src=`/{{{blogPost['feature-image-2']}}}`)
| {{#if blogPost['feature-image-3'] == ""}}
video.postVideo(controls)
source(src=`/{{{blogPost['video']}}}`)
| {{else}}
img.imagePost(src=`/{{{blogPost['feature-image-3']}}}`)
| {{/if}}
| {{#if blogPost['feature-image-4'] != ""}}
img.imagePost(src=`/{{{blogPost['feature-image-4']}}}`)
| {{/if}}
div(style=`float: none;`)
| {{{blogPost['post']}}}
Try adding pull-left along with imagePost in your jade/pug file if you are using bootstrap 3.3. You can also remove the last wrapper div with float none. Final code will looks like this.
div.col-md-6
img.imagePost.pull-left(src=`/{{{blogPost['feature-image-2']}}}`)
| {{#if blogPost['feature-image-3'] == ""}}
video.postVideo(controls)
source(src=`/{{{blogPost['video']}}}`)
| {{else}}
img.imagePost.pull-left(src=`/{{{blogPost['feature-image-3']}}}`)
| {{/if}}
| {{#if blogPost['feature-image-4'] != ""}}
img.imagePost.pull-left(src=`/{{{blogPost['feature-image-4']}}}`)
| {{/if}}
| {{{blogPost['post']}}}
I think it would be useful if you create separate CSS class
See this example :
Css:
.wrapper {
column-count: 2;
column-gap: 50px;
padding: 50px;
}
p {
line-height: 1.6;
font-family: Helvetica;
text-align: justify;
margin: 0;
font-size: 14px;
}
.star {
float: left;
width: 250px;
shape-outside: url(https://upload.wikimedia.org/wikipedia/commons/3/34/Red_star.svg);
shape-margin:20px;
margin-right: 20px;
margin-bottom: 20px;
}
.moon {
border-radius: 50%;
height: 200px;
width:200px;
background-color: #2badd9;
float: right;
shape-outside: inset(1% round 50%);
margin-left: 20px;
margin-bottom: 10px;
}
HTML
<div class="wrapper">
<img src="https://upload.wikimedia.org/wikipedia/commons/3/34/Red_star.svg" alt="" class="star">
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use. </p>
<div class="moon"></div>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use. </p>
</div>
Result will be like this :
It is hard to guess the cause of your problem because you haven't shared the entire HTML so hope this example helps!
Related
I have a simple component in React that essentially expands and collapses when clicked. However, I noticed that the expanding animation is almost instant, while the collapsing animation fulfils the expectation of slowly collapsing the text till 18px.
Did I understand animations wrongly?
https://stackblitz.com/edit/react-plfamb?file=src/style.css
import React, { useState } from 'react';
import './style.css';
const text = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.";
export default function App() {
const [collapsed, setCollapsed] = useState(true);
function handleOnClick() {
setCollapsed(!collapsed);
}
return (
<div
className={collapsed ? 'collapsed' : 'expanded'}
onClick={handleOnClick}
>
{text}
</div>
);
}
styles.css:
.collapsed {
max-height: 18px;
transition: max-height 0.3s ease;
overflow: hidden;
}
.expanded {
max-height: 500px;
transition: max-height 0.3s ease;
}
Missed out overflow: hidden in the expanded class. Many thanks to #KonradLinkowski
How do I insert a banner along with my text I have in my APP? I saw an app that did this, I will insert the image below. The link to access this APP is:https://shiny.rstudio.com/gallery/lego-mosaic.html
Notice it has the text and a blue banner. I would like to do something similar to this. Can you help me?
Thank you very much!
Executable code below:
library(shiny)
ui <- shiny::navbarPage(
title="Test", collapsible = TRUE,
tabPanel("",
br(),
hr(),
h2(HTML("Project <b>Description</b>"),
style="text-align:center; color: blue;"),
hr(),
div(
style = "width: 75%; margin: auto;",
h2(HTML("Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
when an unknown printer took a galley of type and scrambled it to make a type
specimen book. It has survived not only five centuries, but also the leap into electronic
typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of
Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software
like Aldus PageMaker including versions of Lorem Ipsum"),
style="text-align:center"),
h2(HTML("Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
when an unknown printer took a galley of type and scrambled it to make a type
specimen book. It has survived not only five centuries, but also the leap into electronic
typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of
Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software
like Aldus PageMaker including versions of Lorem Ipsum"),
style="text-align:center"))
)
)
server <- function(input, output,session) {
}
shinyApp(ui = ui, server = server)
It's not entirely clear what you want. What about that:
library(shiny)
ui <- fluidPage(
div(
style =
"height: 80px; background-color: blue; width: 100%; position: absolute; right:0;",
div(
style = "height: 100%; background-color: cyan; position: relative; width: fit-content;",
tags$p(
"Here some text vertically centered",
style =
"position: relative; top: 50%; -ms-transform: translateY(-50%); transform: translateY(-50%); padding-right: 10px; padding-left: 10px;"
)
)
)
)
server <- function(input, output, session){}
shinyApp(ui, server)
I am working on one HTML theme. I have an issue with the sticky menu. When scrolling down on the page, Page content jumps up as the header is removed from the natural flow of the page.
I tried by giving margin-top to the main content of the site and it worked. But as I am working on a template, this solution is not useful for me. Any jQuery code would work fine. Thanks for the help in advance!
$(document).ready(function(){
var sticky = $('.header-sticky');
var scroll = $(window).scrollTop();
if (scroll >= 100) sticky.addClass('header-sticky-on');
else sticky.removeClass('header-sticky-on');
});
header {
position: relative;
z-index: 99;
background-color: #ccc;
}
/* Sticky header */
header.header-sticky-on {
position: fixed;
z-index: 1000;
top: 0;
left: 0;
right: 0;
background-color: #fff;
-webkit-animation: fadeInDown .5s;
animation: fadeInDown .5s;
width: 100%;
box-shadow: 0px 0px 40px rgba(83, 88, 93, 0.1);
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<header class="header-sticky">
<!-- =======================
Main header Start-->
<nav class="main-header">
<div class="container">
"Content goes here Content goes here Content goes here"
</div>
</nav>
<!-- =======================
Main header End-->
</header>
<section class="main-content">
<p>
What is Lorem Ipsum?
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
Why do we use it?
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
Where does it come from?
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.
The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.
Where can I get some?
There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.
</p>
</section>
What you could do is add padding-top to the <body> element. So when your sticky header becomes sticky it won't leave a gap between your content and the main wrapper.
This will stop it from jumping around but keeps the flexibility to make your theme.
$(document).scroll(function() {
var sticky = $('.header-sticky');
var scroll = $(window).scrollTop();
/* Added body padding when actived */
if (scroll >= 100) {
sticky.addClass('header-sticky-on');
$('body').addClass('js-sticky-on');
} else {
sticky.removeClass('header-sticky-on');
$('body').removeClass('js-sticky-on');
}
});
/* added: height of element */
body.js-sticky-on {
padding-top: 18px;
}
header {
position: relative;
width: 100%;
z-index: 99;
background-color: #ccc;
}
header.header-sticky-on {
position: fixed;
z-index: 1000;
top: 0;
left: 0;
right: 0;
background-color: #fff;
-webkit-animation: fadeInDown .5s;
animation: fadeInDown .5s;
box-shadow: 0px 0px 40px rgba(83, 88, 93, 0.1);
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<body>
<header class="header-sticky">
<!-- =======================
Main header Start-->
<nav class="main-header">
<div class="container">
"Content goes here Content goes here Content goes here"
</div>
</nav>
<!-- =======================
Main header End-->
</header>
<section class="main-content">
<p>
What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type
specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more
recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Why do we use it? It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The
point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem
Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). Where
does it come from? Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College
in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and
1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..",
comes from a line in section 1.10.32. The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact
original form, accompanied by English versions from the 1914 translation by H. Rackham. Where can I get some? There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour,
or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend
to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The
generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.
</p>
</section>
</body>
I am trying to get a span to always float left within an unordered list item. The code below works fine, until I make the browser width narrow enough to force a line break within the list item - then "the date" no longer appears first. how can I get this span to always appear first ?
<ul class="post-title">
<li> - this is the text. this is the text. this is the text. <span style="float:left">the date</span>
</ul>
what about putting the span first
<ul class="post-title">
<li><span style="float:left">the date</span> - this is the text. this is the text. this is the text.
</ul>
you can enclose both -this is the text.... and the date to span.
<ul class="post-title">
<li>
<span>the date</span>
<span>- this is the text. this is the text. this is the text </span>
</li>
</ul>
so that the date will always appear first.
No need for style="float:left".
I don't know if there is a css solution for this but if you want to use jquery then try this..
var span = $('span');
span.remove();
$('li').prepend(span);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<ul class="post-title">
<li> - Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.<span>the date</span></li>
</ul>
Try this one.
li,ul{
list-style: none;
margin: 0;
padding: 0;
font-size: 20px
}
li{
position: relative;
text-indent: 70px;
}
span{
position: absolute;
background: red;
left: 0;
top: 0;
width: 70px;
text-indent: 0;
}
<ul class="post-title">
<li> - this is the text. this is the text. this is the text. <span>the date</span>
</ul>
Thanks for all of your help. After struggling to make a CSS solution work well, I was able to solve the issue by creating a custom php template for the plug-in: https://github.com/picandocodigo/List-Category-Posts/tree/master/templates
I have this page:
http://projects.kleelof.com/rr_chat_roulette/
It is a very simple page, but, for some reason, when the page is too tall, the vertical scroll bars do not come on.
Could someone take a quick look and tell me what I am doing wrong?
I will post the CSS and related HTML below:
CSS:
body
{
width: 100%;
background-color: #000000;
color: #ffffff;
}
#main_area
{
width: 1000px;
padding-top: 20px;
margin-left: auto;
margin-right: auto;
}
.bottom_text
{
font-family: 'Source Sans Pro', serif;
}
HTML:
<div id="main_area">
<center>
<img src="images/header.png"/>
<br/><br/>
<div id="altContent" style="width:900px; background-color:#000000;">
<h1>rickrose_chat_roulette</h1>
<p>Get Adobe Flash player</p>
</div>
<br/><br/>
<span class="bottom_text" style="font-size: 24px;">Chatroulette &
Omegle Alternative for Hot Good Looking People</span>
<br/><br/>
<span class="bottom_text" style="font-size: 14px;">
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</span>
</center>
</div>
take care,
lee
In answer to your question, on line 31 in your main CSS file you have html,body{overflow:hidden) If you change this to auto then that will solve your problem.