Problems inserting my html code into App.js - html

I made my frontend for a ecommerce site project and wanted to insert my made html code into my React project. When copy and pasting my code into App.js i got multiple problems and errors which are actually really simple problems but the normal fix won't do it.
My tag connects with my closing div tag and so my open div tag has no closing tag no more.
Ive added some pictures with their errors to make it easier to see.
function App() {
return (
<div className="header">
<div className="container">
<div className="navbar">
<a href="index.html" class="logo">
<h1 style="font-size: 30px;">FLOWERPOWER!<br/>WWW.FLOWERPOWER.NL</h1>
</a>
<nav>
<ul id="MenuItems">
<li>Home</li>
<li>Producten</li>
<li>Tips</li>
<li>Over ons</li>
<li>Contact</li>
<li>Account</li>
</ul>
</nav>
<img src="images/cart.png" width="30px" height="30px"/>
<img src="images/menu.png" class="menu-icon" onclick="menutoggle()"/>
</div>
<div className="row">
<div className="col-2">
<h1>Koop uw feestboeketten hier!</h1>
<p>Ma-za voor 14 uur besteld? Zelfde dag bezorgd,<br/>
Bezorging in heel Nederland<p/>
Kies uit! →
</div>
<div className="col-2">
<img src="images/banner.png"/>
</div>
</div>
</div>
</div>
<div className="categorieen">
<div className="small-container">
<h2 className="title" style="font-size: 50px"> Boeket van de maand</h2>
<div className="row">
<div className="col-3">
<img src="images/featuredbloem.jpg"/>
</div>
</div>
</div>
</div>
<div className="small-container">
<h2 className="title" style="font-size: 50px">Featured product</h2>
<div className="row">
<div className="col-4">
<a href="producten/passievol-details.html">
<img src="images/bloem1.png"/></a>
<h4>Passievol</h4>
<div className="rating">
<i className="fas fa-star"></i>
<i className="fas fa-star"></i>
<i className="fas fa-star"></i>
<i className="fas fa-star"></i>
<i className="far fa-star"></i>
</div>
<p>vanaf $ 79,95</p>
</div>
<div className="col-4">
<a href="producten/welkompasen-details.html">
<img src="images/bloem2.png"/></a>
<h4>Welkom Pasen</h4>
<div className="rating">
<i className="fas fa-star"></i>
<i className="fas fa-star"></i>
<i className="fas fa-star"></i>
<i className="fas fa-star"></i>
<i className="far fa-star"></i>
</div>
<p>vanaf $ 19,95</p>
</div>
<div className="col-4">
<a href="producten/vrolijkpasen-details.html">
<img src="images/bloem3.png"/></a>
<h4>Vrolijk Pasen</h4>
<div className="rating">
<i className="fas fa-star"></i>
<i className="fas fa-star"></i>
<i className="fas fa-star"></i>
<i className="fas fa-star"></i>
<i className="far fa-star"></i>
</div>
<p>vanaf $ 29,95</p>
</div>
<div className="col-4">
<a href="producten/eindelijkvoorjaar-details.html">
<img src="images/bloem4.jpg"/></a>
<h4>Eindelijk voorjaar</h4>
<div class="rating">
<i className="fas fa-star"></i>
<i className="fas fa-star"></i>
<i className="fas fa-star"></i>
<i className="fas fa-star"></i>
<i className="far fa-star"></i>
</div>
<p>vanaf $ 24,95</p>
</div>
</div>
</div>
<div className="footer">
<div className="container">
<div className="row">
<div className="footer-col-1">
<h3>FLOWERPOWER</h3>
<ul>
<li>Over Ons</li>
<li>Contact</li>
<li>Tips</li>
<li>Lorum</li>
<li>Lorum</li>
<li>Lorum</li>
</ul>
</div>
<div className="footer-col-2">
<h3>Zakelijk</h3>
<ul>
<li>Lorum</li>
<li>Lorum</li>
<li>Lorum</li>
</ul>
</div>
</div>
</div>
</div>
<div className="brands">
<div className="small-container">
<div className="row">
<div className="col-5">
<img src="images/logo-ideal.png"/>
</div>
<div className="col-5">
<img src="images/logo-paypal.png"/>
</div>
<div className="col-5">
<img src="images/logo-americanexpress.png"/>
</div>
<div className="col-5">
<img src="images/logo-visa.png"/>
</div>
</div>
<p className="copyright">Copyright © 2021 FLOWERPOWER! - flowerpower.nl Alle rechten voorbehouden.</p>
</div>
</div>
</div>
);
}
export default App;

Your screenshots shows 1 potential error.
You Misplaced closing tag for p element on line 28 screenshot 1
<p> .... <p/>
It should read
<p> .... </p>
Edit:
Your code has 2 issues,
unbalanced div tags,
style props
1st Issue:: Replace this block of code
<div className="col-2">
<h1>Koop uw feestboeketten hier!</h1>
<p>Ma-za voor 14 uur besteld? Zelfde dag bezorgd,<br />
Bezorging in heel Nederland<p />
Kies uit! →
</div>
<div className="col-2">
<img src="images/banner.png" />
</div>
</div>
</div>
with this
<div className="col-2">
<h1>Koop uw feestboeketten hier!</h1>
<p>Ma-za voor 14 uur besteld? Zelfde dag bezorgd,<br />
Bezorging in heel Nederland</p>
Kies uit! →
<div className="col-2">
<img src="images/banner.png" />
</div>
</div>
</div>
2nd Issue:: React style tags acceps an object, and not string
<div style={{fontSize:'20px}}></div>

I think the problem is coming from the fact that, the <div className="header"> ... </div> and <div className="brands"> ... </div> are not all wrapped within a single fragment in the return function. If you correct your code to:
...
function App() {
return(
<>
<div className="header"> ... </div>
<div className="brands"> ... </div>
</>
);
}
export default App;
The error will disappear. Also note that, I have replaced class="" attribute with className="".
Hope the answer is helpful.

React intellisense is getting mad due to you having "class". You need to rename it to className. (this is true for all JSX elements, such as div, a, p, etc...)

Related

Why is my title of my pages not positioned correctly?

I have a component named admin.component, in this component, I have a menu and a header.
In fact, when I create a new page, for example: the currency page.
The title is at the bottom of the la page, I don't understand why?
Normally, the title must be at the top...
I think that the component admin.component.html isnt't correct?
<div class="sidebar">
<div class="logo-details">
<i class="bx bxl-c-plus-plus"></i>
<span class="logo_name">Menu</span>
</div>
<ul class="nav-links">
<li>
<a routerLink="value" class="active">
<i class="bx bx-grid-alt"></i>
<span class="links_name">Value</span>
</a>
</li>
<li>
<a routerLink="currency">
<i class="bx bx-box"></i>
<span class="links_name">Currency</span>
</a>
</li>
</ul>
</div>
<section class="home-section">
<nav>
<div class="sidebar-button">
<i class="bx bx-menu sidebarBtn"></i>
<span class="dashboard">Dashboard</span>
</div>
<div class="search-box">
<input type="text" placeholder="Search..." />
<i class="bx bx-search"></i>
</div>
<div class="profile-details">
<span class="admin_name">Prem Shahi</span>
<i class="bx bx-chevron-down"></i>
</div>
</nav>
</section>
For the currency.component.html page, I have this:
<div class="home-content">
<h1 style="text-align: center">Currency Page</h1>
</div>
The code is available here, if you wish.
It's working now need to change in admin.component.html with below stracture and resolved issue easily
<router-outlet>
<div class="sidebar">
<div class="logo-details">
<i class="bx bxl-c-plus-plus"></i>
<span class="logo_name">Menu</span>
</div>
<ul class="nav-links">
<li>
<a routerLink="value" class="active">
<i class="bx bx-grid-alt"></i>
<span class="links_name">Value</span>
</a>
</li>
<li>
<a routerLink="currency">
<i class="bx bx-box"></i>
<span class="links_name">Currency</span>
</a>
</li>
</ul>
</div>
<section class="home-section">
<nav>
<div class="sidebar-button">
<i class="bx bx-menu sidebarBtn"></i>
<span class="dashboard">Dashboard</span>
</div>
<div class="search-box">
<input type="text" placeholder="Search..." />
<i class="bx bx-search"></i>
</div>
<div class="profile-details">
<span class="admin_name">Prem Shahi</span>
<i class="bx bx-chevron-down"></i>
</div>
</nav>
<router-outlet></router-outlet>
</section>
</router-outlet>
only add <router-outlet></router-outlet> after </nav> tag and check upper code so you will get idea how to implement
Top Header is now fixed and only content will be change like below ss

Thumbnail image is not fitting the entire column when resizing

I have included a sidebar in one column and 3 thumbnails in another 3 columns in a row. The thumbnail image is fitting the entire columns at first but when I resize the thumbnail images are getting smaller keeping the column in full width (as for usual bootstrap responsive works). I need to stretch my images as that of the column they are filled in.
Here's my HTML:
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container-fluid side-navigation-bar">
<div class="row">
<!--==========================================-->
<!--Side navigation bar-->
<!--==========================================-->
<div class="col-md-3 col-md-3-thumbnail">
<div class="nav-side-menu" >
<div class="brand"><i class="fa fa-heartbeat"> myVitals.com</i></div>
<i class="fa fa-bars fa-2x toggle-btn" data-toggle="collapse" data-target="#menu-content"></i>
<div class="menu-list" >
<ul id="menu-content" class="menu-content collapse out" >
<li>
<a href="#">
<i class="fa fa-home fa-lg fa-fw"></i> Home
</a>
</li>
<li>
<a href="#">
<i class="fa fa-book fa-lg fa-fw"></i> My Appointments
</a>
</li>
<li>
<a href="#">
<i class="fa fa-s15 fa-lg fa-fw"></i> Facilities
</a>
</li>
<li>
<i class="fa fa-cogs fa-lg fa-fw"></i> Services
</li>
<li>
<i class="fa fa-stethoscope fa-lg fa-fw"></i> Doctors
</li>
<li>
<a href="#">
<i class="fa fa-medkit fa-lg fa-fw"></i> Medications
</a>
</li>
<li>
<a href="#">
<i class="fa fa-medkit fa-lg fa-fw"></i> Medications
</a>
</li>
</ul>
</div>
</div>
</div>
<!--==========================================-->
<!--End of Side navigation bar-->
<!--==========================================-->
<!--==========================================-->
<!--Cards-->
<!--==========================================-->
<div id="column" class="col-md-3 col-sm-6 col-md-3-thumbnail text-center">
<div class="thumbnail">
<figure class="imghvr-hinge-down">
<img src="http://via.placeholder.com/320x211" alt="Bootstrap Thumbnail Customization">
</figure>
<div class="caption">
<h5><b>Bootstrap Cards Design</b></h5>
<p class="card-description">Hi there How are you?</p>
<p>Read More</p>
</div>
</div>
</div>
<div id="column" class="col-md-3 col-sm-6 col-md-3-thumbnail text-center">
<div class="thumbnail">
<figure class="imghvr-hinge-down">
<img src="http://via.placeholder.com/320x211" alt="Bootstrap Thumbnail Customization">
</figure>
<div class="caption">
<h5><b>Bootstrap Cards Design</b></h5>
<p class="card-description">Hi there How are you?</p>
<p>Read More</p>
</div>
</div>
</div>
<div id="column" class="col-md-3 col-sm-6 col-md-3-thumbnail text-center">
<div class="thumbnail">
<figure class="imghvr-hinge-down">
<img src="http://via.placeholder.com/320x211" alt="Bootstrap Thumbnail Customization">
</figure>
<div class="caption">
<h5><b>Bootstrap Cards Design</b></h5>
<p class="card-description">Hi there How are you?</p>
<p>Read More</p>
</div>
</div>
</div>
</div>
</div>
I even tried the width:100% for the thumbnail image as
.thumbnail > img{width:100%; display:block;}
The problem is, the img is not taking the full-width as that of its column
Can anyone please help me???
Used .img-fluid for responsive image in Bootstrap.4. it have following css:
.img-fluid {
max-width: 100%;
height: auto;
}
https://getbootstrap.com/docs/4.0/content/images/
You can just set the width to 100% and the height to auto, this will expand it to full width.
CSS:
.thumbnail > figure > img {
width: 100%;
height: auto;
}
JSFiddle Demo

DIV's are not alighning properly

I am having trouble with placing my div's in the right position. I made some changes, but it does not work. I would like to put all elements in one row, but title is not aligning properly with the logo. I thought that the problem is in grid, but it is not.
Here is my code.
<body <?php body_class('compass_theme'); ?>>
<div class="container_24">
<div class="grid_24">
<div class="page_content_wrapper">
<div class="header animated">
<div class="grid_10 alpha">
<div class="logo grid_10 alpha" id="logomob">
<img src="<?php if (compass_get_option('compass_logo') != '') { ?><?php echo compass_get_option('compass_logo'); ?><?php } else { ?><?php echo get_template_directory_uri(); ?>/images/logo.png<?php } ?>" alt="<?php bloginfo('name'); ?> logo"/>
</div>
<div class="titleText grid_14 alpha">
<h1 id="title">
<span id="title-top">Adriatic Yacht</span></br>
<span id="title-bottom">Professionals</span>
</h1>
<h2 id="slogan">We can repair everything, except human lives!</h2>
</div>
</div>
<div class="grid_14 alpha contactIcons" id="desktop">
<div class="grid_6 alpha" id="phone">
<i class="fa fa-phone-square" aria-hidden="true"></i>
<p class="contact">+382-67-507-234</p>
</div>
<div class="grid_6 alpha contactIcons" id="email">
<i class="fa fa-envelope-square" aria-hidden="true"></i>
<p class="contact">info#adriatic-yacht.pro</p>
</div>
<div class="grid_6 alpha contactIcons" id="skype">
<i class="fa fa-skype" aria-hidden="true"></i>
<p class="contact">ID: adriaticyacht</p>
</div>
</div>
<div class="grid_14 alpha1" id="mobile">
<section class="deskContact">
<i class="fa fa-skype" aria-hidden="true"></i>
<p class="contact">ID: adriaticyacht</p>
</section>
<section class="deskContact">
<i class="fa fa-envelope-square" aria-hidden="true"></i>
<p class="contact">info#adriatic-yacht.pro</p>
</section>
<section class="deskContact">
<i class="fa fa-phone-square" aria-hidden="true"></i>
<p class="contact">+382-67-507-234</p>
</section>
</div>
<div class="clear"></div>
</div>

How to show correctly a single <UL> inside a ROW class in Boostrap

I am creating a web page where i want to show multiple rows of images. I am using Bootstrap 3.3.7 and have the following code. What is happening is that when using a col-md3, the last images are not show correctly. I want to have them in the same row, starting from left to right, but they are in the middle of the row or some other position.
<div class="staff-picked-posts padding-top-70 background-color-gray padding-bottom-40" id="chennal-page">
<div class="container">
<div class="tab-content">
<div class="slide tab-pane active" id="l">
<div class="">
<div class="item active">
<div class="row">
<ul class="staff-picked-videos">
<li class="col-md-3 col-sm-4 col-xs-12">
<div class="post-details">
<div class="overlay-inner-image">
<img src="https://i.ytimg.com/vi/o3Kbc-LSGvI/hqdefault.jpg" alt="">
<a a="" class="inner-image-overlay" href="/Home/Detail/41/these-athletes-are-incredibly-angry-want-to-check-out-their-reactions"></a>
<div class="watch-icon" data-toggle="tooltip" title="" data-original-title="Watch Later">
<i class="fa fa-clock-o" aria-hidden="true"></i>
</div>
</div>
<div class="image-content background-color-light-green">
<h3>These athletes are incredibly angry. Want to check out their reactions?</h3>
<!--<p>kocco.co<i class="fa fa-check-circle-o trending-post"></i></p>-->
<p class="margin-bottom-0">4/30/2017 <span><i class="fa fa-eye"></i> 0 </span><i class="fa fa-thumbs-o-up"></i> 0</p>
</div>
</div>
</li>
<li class="col-md-3 col-sm-4 col-xs-12">
<div class="post-details">
<div class="overlay-inner-image">
<img src="https://i.ytimg.com/vi/H2EXKlJ0pfI/hqdefault.jpg" alt="">
<a a="" class="inner-image-overlay" href="/Home/Detail/44/most-shocking-boxing-moments-want-to-check"></a>
<div class="watch-icon" data-toggle="tooltip" title="" data-original-title="Watch Later">
<i class="fa fa-clock-o" aria-hidden="true"></i>
</div>
</div>
<div class="image-content background-color-light-green">
<h3>Most Shocking Boxing moments. Want to check? </h3>
<!--<p>kocco.co<i class="fa fa-check-circle-o trending-post"></i></p>-->
<p class="margin-bottom-0">4/30/2017 <span><i class="fa fa-eye"></i> 0 </span><i class="fa fa-thumbs-o-up"></i> 0</p>
</div>
</div>
</li>
<li class="col-md-3 col-sm-4 col-xs-12">
<div class="post-details">
<div class="overlay-inner-image">
<img src="https://i.ytimg.com/vi/3jT_q7dt-cM/hqdefault.jpg" alt="">
<a a="" class="inner-image-overlay" href="/Home/Detail/45/top-10-crazy-moments-in-sports"></a>
<div class="watch-icon" data-toggle="tooltip" title="" data-original-title="Watch Later">
<i class="fa fa-clock-o" aria-hidden="true"></i>
</div>
</div>
<div class="image-content background-color-light-green">
<h3>Top 10 Crazy Moments in Sports </h3>
<!--<p>kocco.co<i class="fa fa-check-circle-o trending-post"></i></p>-->
<p class="margin-bottom-0">4/30/2017 <span><i class="fa fa-eye"></i> 0 </span><i class="fa fa-thumbs-o-up"></i> 0</p>
</div>
</div>
</li>
<li class="col-md-3 col-sm-4 col-xs-12">
<div class="post-details">
<div class="overlay-inner-image">
<img src="https://i.ytimg.com/vi/RvklO0O3BcY/hqdefault.jpg" alt="">
<a a="" class="inner-image-overlay" href="/Home/Detail/46/top-20-funny-moments-in-soccer"></a>
<div class="watch-icon" data-toggle="tooltip" title="" data-original-title="Watch Later">
<i class="fa fa-clock-o" aria-hidden="true"></i>
</div>
</div>
<div class="image-content background-color-light-green">
<h3>Top 20 funny moments In Soccer </h3>
<!--<p>kocco.co<i class="fa fa-check-circle-o trending-post"></i></p>-->
<p class="margin-bottom-0">4/30/2017 <span><i class="fa fa-eye"></i> 0 </span><i class="fa fa-thumbs-o-up"></i> 0</p>
</div>
</div>
</li>
<li class="col-md-3 col-sm-4 col-xs-12">
<div class="post-details">
<div class="overlay-inner-image">
<img src="https://i.ytimg.com/vi/_c55cW6UGP0/hqdefault.jpg" alt="">
<a a="" class="inner-image-overlay" href="/Home/Detail/50/ronaldinho-making-amazing-plays-in-soccer"></a>
<div class="watch-icon" data-toggle="tooltip" title="" data-original-title="Watch Later">
<i class="fa fa-clock-o" aria-hidden="true"></i>
</div>
</div>
<div class="image-content background-color-light-green">
<h3>Ronaldinho making amazing plays in soccer. </h3>
<!--<p>kocco.co<i class="fa fa-check-circle-o trending-post"></i></p>-->
<p class="margin-bottom-0">4/30/2017 <span><i class="fa fa-eye"></i> 0 </span><i class="fa fa-thumbs-o-up"></i> 0</p>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
EDIT 1:
ANSWER THANKS TO Shariqkhan
/*screen-sm*/
#media (min-width: 768px) and (max-width: 992px) {
.staff-picked-videos .col-sm-4:nth-child(3n+1) {
clear: both;
}
}
/*screen-md*/
#media (min-width: 992px) and (max-width: 1200px) {
staff-picked-videos .col-md-3:nth-child(4n+1) {
clear: both;
}
}
/*screen-lg corresponds with col-lg*/
#media (min-width: 1200px) {
staff-picked-videos .col-md-3:nth-child(4n+1) {
clear: both;
}
}
The first column on every new row should clear i.e they should have clear:both in their css markup.
In your example the first column (These athletes are...), 5th column (Ronaldinho making...) should clear floats.
So you should add this CSS rule:
.staff-picked-videos .col-md-3:nth-child(4n+1) {
clear: both;
}
I think the expected behaviour is:
CardA CardB CardC CardD
CardE ...
Right?
If yes, the root cause of your problem is: The height of cards are different. In your case, CardA's height is larger than CardB, when CardB is placed in new row, browser will try to find the most left and most top position (unfortunately, "top" has higher priority than "left", which is the behaviour of float -- the underline CSS rule used by col-md-3). So, if CardA's height is 110 and CardB&CardC&CardD's height is 100, the result would be:
CardA CardB CardC CardD
CardE ...
If CardA's height is 110 and CardB's height is 105 and CardC&CardD's height is 100, the result would be:
CardA CardB CardC CardD
CardE ...
To implement your expected behaviour, cards should be placed in columns, not rows. For example, CardA and CardE should be put into one <div>, CardB and CardF should be put into another <div> etc.
Your columns will not have class col-md-3. Instead they will have col-md-2 where first column will have an additional class col-md-offset-1
Your column structure would look like this -
<div class="row">
<div class="col-md-2 col-md-offset-1"></div>
<div class="col-md-2"></div>
<div class="col-md-2"></div>
<div class="col-md-2"></div>
<div class="col-md-2"></div>
</div>
The offset adds space to the left of your element.
You can see the first li height is increased due to that only this issue is caused due to lengthy title please use excerpt css for title https://www.w3schools.com/cssref/tryit.asp?filename=trycss3_text-overflow . You can set maximum height to the post and also give overflow hidden or please use excerpt css to the title of the post if the height of all post is adjusted by maximum height css your issue will be fixed.

How to make images , iframes, icons stand beside texts without break

I've spent three hours trying to reproduce the image above, however I am unable to make the texts remain on the side and centered with facebook-pile and icons. Can anyone help me?
Code:
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<section class="social-media">
<div class="container">
<div class="row">
<div class="col-md-6">
<div class="fb-pile">
<h2> no Facebook:</h2>
<div class="fb-facepile" data-href="https://www.facebook.com/facebookdevelopers" data-max-rows="1" data-colorscheme="light" data-size="small" data-show-count="true"></div>
</div>
</div>
<div class="col-md-4">
<div class="social-icons">
<h2>Compartilhar:</h2>
<a target="_blank" href="" title="Ir para página do facebook">
<span class="fa fa-facebook fa-2x"></span>
</a>
<a target="_blank" href="" title="Ir para página do twitter">
<span class="fa fa-twitter fa-2x"></span>
</a>
<a target="_blank" href="" title="Ir para página do instagram">
<span class="fa fa-instagram fa-2x"></span>
</a>
</div>
</div>
<div class="col-md-2">
<div class="trip-advisor">
<img class="trip-advisor-img" title="Recomende o Pub Crawl no Trip Advisor" src="http://upload.wikimedia.org/wikipedia/fr/1/1d/TripAdvisor-logo.png"/>
</div>
</div>
</div>
</div>
</section>
Try changing the .social-media h2 style to include display: inline-block instead of floating it:
http://codepen.io/a_double/pen/EayaOa